Strings
String Predicates
-
(string?val) - Standard String Predicate.
Determine if
valis a string.
String Constructors
-
(make-stringlengthch) - Standard String Procedure.
Create a new string of length
length, containing only copies ofch. -
(stringch_0ch_1...ch_n) - Standard String Procedure.
Create a new string of length
n+1, by concatenating all ofch_0throughch_n. -
(string-appendstr_0str_1...str_n) - Standard String Procedure.
Create a new string of by joining together
strthroughstr_nin order. (Much likeappend, but for strings, rather than lists.)
Extracting Information from Strings
-
(string-lengthstr) - Standard String Procedure.
Determine the number of characters in
str. -
(string-refstrpos) - Standard String Procedure.
Extract the character at a specified position from a string. Like
list-ref,string-refpresupposes zero-based indexing; the position is specified by the number of characters that precede it in the string. Hence, the initial character in the string is at position 0, the next at position 1, and so on.) -
(substringstrstartend) - Standard String Procedure.
Create a new string by selecting the characters at positions
starttoend-1 ofstr. Note thatsubstring, likestring-refuses 0-based indexing.
Converting Strings
-
(string->liststr) - Standard String Procedure.
Convert
strto a list of characters. The ith element of the list is the ith character in the string. -
(list->stringchar-list) - Standard String Procedure.
Convert
char-list(which must be a list of characters) to a string. The ith element of the list becomes the ith character in the string. -
(string->numberstr) - Standard String Procedure.
Given a string that naturally represents a number (e.g.,
"23"or"3.14", or even"2.11e-5"), return the corresponding number. -
(number->stringnum) - Standard String Procedure.
Convert
numto an appropriate textual representation.
Comparing Strings
-
(string<?str1str2) - Standard String Procedure.
Determine whether
str1lexicographically precedesstr2. Bothstr1andstr2must be strings. -
(string<=?str1str2) - Standard String Procedure.
Holds if
str1is either the same asstr2or ifstr1lexicographically precedesstr2. Bothstr1andstr2must be strings. -
(string=?str1str2) - Standard String Procedure.
Holds if
str1is the same asstr2. Bothstr1andstr2must be strings. -
(string>=?str1str2) - Standard String Procedure.
Holds if
str1is either the same asstr2or ifstr1lexicographically followsstr2. Bothstr1andstr2must be strings. -
(string>?str1str2) - Standard String Procedure.
Determine whether
str1lexicographically followsstr2. Bothstr1andstr2must be strings.
-
(string-ci<?str1str2) - Standard String Procedure.
Determine whether
str1lexicographically precedesstr2, ignoring case. Bothstr1andstr2must be strings. -
(string-ci<=?str1str2) - Standard String Procedure.
Holds if
str1is either the same asstr2or ifstr1lexicographically precedesstr2, ignoring case. Bothstr1andstr2must be strings. -
(string-ci=?str1str2) - Standard String Procedure.
Holds if
str1is the same asstr2, ignoring case. Bothstr1andstr2must be strings. -
(string-ci>=?str1str2) - Standard String Procedure.
Holds if
str1is either the same asstr2or ifstr1lexicographically followsstr2, ignoring case. Bothstr1andstr2must be strings. -
(string-ci>?str1str2) - Standard String Procedure.
Determine whether
str1lexicographically followsstr2, ignoring case. Bothstr1andstr2must be strings.