|
![]() |
(ascii "A") returns 65
(ascii "CAT") returns 67
(ascii "476.25") returns 52
(chr 65) return "A"
(chr 67) return "C"
(chr 97) returns "a"
(chr 51) returns "T"
(chr 34) returns " (a double quotation mark)
(strlen "25 books") returns 8
(strlen "15 + 17") returns 7
(strlen "") returns 0
(strcat "Auto" "LISP") returns "AutoLISP"
After (setq a "2.50" b "1.80")
(strcat a "," b) returns "2.50,1.80"
(substr "America" 2 5) returns "meric"
(substr "Chicago" 6 4) returns "go"
(substr "Chicago" 6) returns "go"
(strcase "678 Pine Hollow Blvd.") returns "678 PINE HOLLOW BLVD."
(strcase "678 Pine Hollow Blvd." 1) returns "678 pine hollow
blvd."
(wcmatch "Greetings" "H*") returns nil because the pattern requires
that the string start with "H"
(wcmatch "Hello" "H*") returns T because the wild card "*" in
the pattern allows anything after the "H"
(wcmatch "hello" "H*") returns nil because the "h" in the test
string is lower case
(wcmatch "J7" "@#") returns T because "J" is alphabetic, and
"7" is numeric
(wcmatch "rice" "[lmnrv]ice") returns T because the "r" in "rice" matches
one of the letters in the square brackets
(wcmatch "4,592" "*9*") returns T because the pattern allows a "9"
anywhere in the test string
(wcmatch "123" "###,####") returns T because "123" is a 3 digit number
(3 or 4 digit numbers are allowed)
(wcmatch "4,592" "*`,*) returns T because the pattern allows a comma
anywhere in the test string (the reverse quote "`" causes the comma to
be read literally rather than as a separator, as in previous example)
After (setq testme "Howdy" pattern "H*")
(wcmatch testme pattern) returns T