STRING FUNCTIONS
Note: functions with names starting "string" will also accept a symbol, in which case the symbol's print name is used.
MAKE A STRING FROM AN INTEGER ASCII VALUE
(string <expr>)
- <expr> an integer (which is first converted into its ASCII character value), string, character, or symbol
- returns the string representation of the argument
TRIM BOTH ENDS OF A STRING
(string-trim <bag> <str>)
- <bag> a string containing characters to trim
- <str> the string to trim
- returns a trimed copy of the string
TRIM THE LEFT END OF A STRING
(string-left-trim <bag> <str>)
- <bag> a string containing characters to trim
- <str> the string to trim
- returns a trimed copy of the string
TRIM THE RIGHT END OF A STRING
(string-right-trim <bag> <str>)
- <bag> a string containing characters to trim
- <str> the string to trim
- returns a trimed copy of the string
CONVERT TO UPPERCASE
(string-upcase <str> &key :start :end)
- <str> the string
- :start the starting offset
- :end the ending offset + 1 or NIL for end of string
- returns a converted copy of the string
CONVERT TO LOWERCASE
(string-downcase <str> &key :start :end)
- <str> the string
- :start the starting offset
- :end the ending offset + 1 or NIL for end of string
- returns a converted copy of the string
CAPITALIZE STRING
(string-capitalize <str> &key :start :end)
- <str> the string
- :start the starting offset
- :end the ending offset + 1 or NIL for end of string
- returns a converted copy of the string with each word having an initial uppercase letter and following lowercase letters
CONVERT TO UPPERCASE
(nstring-upcase <str> &key :start :end)
- <str> the string
- :start the starting offset
- :end the ending offset + 1 or NIL for end of string
- returns the converted string (not a copy)
CONVERT TO LOWERCASE
(nstring-downcase <str> &key :start :end)
- <str> the string
- :start the starting offset
- :end the ending offset + 1 or NIL for end of string
- returns the converted string (not a copy)
CAPITALIZE STRING
(nstring-capitalize <str> &key :start :end)
- <str> the string
- :start the starting offset
- :end the ending offset + 1 or NIL for end of string
- returns the string with each word having an initial uppercase letter and following lowercase letters (not a copy)
CONCATENATE STRINGS
(strcat <expr>...)
Macro in init.lsp, to maintain compatibility with XLISP.
See CONCATENATE for preferred function.
- <expr> the strings to concatenate
- returns the result of concatenating the strings
(string< <str1> <str2> &key :start1 :end1 :start2 :end2)
(string<= <str1> <str2> &key :start1 :end1 :start2 :end2)
(string= <str1> <str2> &key :start1 :end1 :start2 :end2)
(string/= <str1> <str2> &key :start1 :end1 :start2 :end2)
- <str1> the first string to compare
- <str2> the second string to compare
- :start1 first substring starting offset
- :end1 first substring ending offset + 1 or NIL for end of string
- :start2 second substring starting offset
- :end2 second substring ending offset + 1 or NIL for end of string
- returns string=: t if predicate is true, NIL otherwise
others: If predicate is true then number of initial matching characters, else NIL
Note: case is significant with these comparison functions.
(string-lessp <str1> <str2> &key :start1 :end1 :start2 :end2)
(string-not-greaterp <str1> <str2> &key :start1 :end1 :start2 :end2)
(string-equal <str1> <str2> &key :start1 :end1 :start2 :end2)
(string-not-equal <str1> <str2> &key :start1 :end1 :start2 :end2)
(string-not-lessp <str1> <str2> &key :start1 :end1 :start2 :end2)
(string-greaterp <str1> <str2> &key :start1 :end1 :start2 :end2)
- <str1> the first string to compare
- <str2> the second string to compare
- :start1 first substring starting offset
- :end1 first substring ending offset + 1 or NIL for end of string
- :start2 second substring starting offset
- :end2 second substring ending offset + 1 or NIL for end of string
- returns string-equal: t if predicate is true, NIL otherwise
others: If predicate is true then number of initial matching characters, else NIL
Note: case is not significant with these comparison functions -- all uppercase characters are converted to lowercase before being compared.
XLISP-PLUS - Version 2.1g - Tom Almy
tom.almy@tek.com - 18 JUL 94
Generated with WebMaker