Next: srfi strings spec prefix, Previous: srfi strings spec modify, Up: srfi strings spec [Index]
Apply proc<, proc=, or proc> to the mismatch index,
depending upon whether str1 is less than, equal to, or greater
than str2. The “mismatch index” is the largest index i
such that for every 0 <= j < i
, s1[j] = s2[j]
; that is,
i is the first position that doesn’t match.
The optional start/end indices restrict the comparison to the indicated substrings of str1 and str2. The mismatch index is always an index into str1; in the case of proc=, it is always end1; we observe the protocol in this redundant case for uniformity.
(string-compare "The cat in the hat" "abcdefgh" values values values 4 6 ; Select "ca" 2 4) ; & "cd" => 5 ; Index of S1's "a"
True text collation is not handled by this SRFI.
Case–insensitive variant of string-compare
.
The following 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.
The optional start/end indices restrict the comparison to the indicated substrings of str1 and str2.
True text collation is not handled by this SRFI.
Lexicographic ordering on strings induced by the ordering char=?
on characters.
Lexicographic ordering on strings induced by the negation of the
ordering char=?
on characters.
Lexicographic ordering on strings induced by the ordering char<?
on characters.
Lexicographic ordering on strings induced by the ordering char>?
on characters.
Lexicographic ordering on strings induced by the ordering char<=?
on characters.
Lexicographic ordering on strings induced by the ordering char>=?
on characters.
Case–insensitive variant of string=
.
Case–insensitive variant of string<>
.
Case–insensitive variant of string<
.
Case–insensitive variant of string>
.
Case–insensitive variant of string<=
.
Case–insensitive variant of string>=
.
Compute a hash value for the string str and return it as a fixnum.
bound is a non–negative exact integer specifying the range of the
hash function. A positive value restricts the return value to the range
between 0
included and bound excluded.
If bound is either zero or not given, it defaults to
(greatest-fixnum)
.
The optional start/end indices restrict the hash operation to the indicated substring of str.
string-hash-ci
is the case–insensitive variant.
Invariants:
(<= 0 (string-hash s b) (- b 1)) ; When B > 0. (string= s1 s2) ⇒ (= (string-hash s1 b) (string-hash s2 b)) (string-ci= s1 s2) ⇒ (= (string-hash-ci s1 b) (string-hash-ci s2 b))
Next: srfi strings spec prefix, Previous: srfi strings spec modify, Up: srfi strings spec [Index]