Next: baselib vectors, Previous: baselib characters, Up: baselib [Index]
Strings are sequences of characters. The length of a string is the number of characters that it contains. This number is fixed when the string is created. The valid indices of a string are the integers less than the length of the string. The first character of a string has index 0, the second has index 1, and so on.
Return #t
if obj is a string, #f
otherwise.
Return a newly allocated string of length k. If char is given, then all elements of the string are initialized to char, otherwise the contents of the string are unspecified.
Return a newly allocated string composed of the arguments.
Return the number of characters in the given string as an exact integer object.
k must be a valid index of string. The string-ref
procedure returns character k of string using zero–origin
indexing.
NOTE Implementors should make
string-ref
run in constant time.
Return #t
if the strings are the same length and contain the same
characters in the same positions. Otherwise, the string=?
procedure returns #f
.
(string=? "Strause" "Strasse") ⇒ #f
These procedures are the lexicographic extensions to strings of the
corresponding orderings on characters. For example, string<?
is
the lexicographic ordering on strings induced by the ordering
char<?
on characters. If two strings differ in length but are
the same up to the length of the shorter string, the shorter string is
considered to be lexicographically less than the longer string.
(string<? "z" "a") ⇒ #t (string<? "z" "zz") ⇒ #t (string<? "z" "Z") ⇒ #f
string must be a string, and start and end must be exact integer objects satisfying:
0 <= start <= end <= (string-length string)
The substring
procedure returns a newly allocated string formed
from the characters of string beginning with index start
(inclusive) and ending with index end (exclusive).
Return a newly allocated string whose characters form the concatenation of the given strings.
list must be a list of characters.
The string->list
procedure returns a newly allocated list of the
characters that make up the given string.
The list->string
procedure returns a newly allocated string
formed from the characters in list.
The string->list
and list->string
procedures are inverses
so far as equal?
is concerned.
The strings must all have the same length. proc should accept as many arguments as there are strings.
The string-for-each
procedure applies proc element–wise to
the characters of the strings for its side effects, in order from
the first characters to the last. proc is always called in the
same dynamic environment as string-for-each
itself. The return
values of string-for-each
are unspecified.
Analogous to for-each
.
Implementation responsibilities: The implementation must check the restrictions on proc to the extent performed by applying it as described. An implementation may check whether proc is an appropriate argument before applying it.
Return a newly allocated copy of the given string.
Next: baselib vectors, Previous: baselib characters, Up: baselib [Index]