string-ci=?(3scm) Scheme Programmer's Manual string-ci=?(3scm)

string-ci=?, string-ci<?, string-ci>?, string-ci<=?, string-ci>=? - case-insensitive string comparison

(import (rnrs))                     ;R6RS
(import (rnrs unicode))             ;R6RS
(import (scheme r5rs))              ;R7RS
(import (scheme char))              ;R7RS

(string-ci=? string1 string2 string3 ...)
(string-ci<? string1 string2 string3 ...)
(string-ci>? string1 string2 string3 ...)
(string-ci<=? string1 string2 string3 ...)
(string-ci>=? string1 string2 string3 ...)

These procedures are similar to string=?, string<?, etc., but operate on the case-folded versions of the strings. Case-folding is done as if by applying string-foldcase(3scm) to the strings.

Returns a single value, a boolean.

(string-ci=? "z" "Z")  =>  #t
;; May return #t in R7RS.
(string-ci<? "z" "Z")  =>  #f
;; Can return #f in R7RS, and the characters may not be supported.
(string-ci=? "Straße" "Strasse")  =>  #t
(string-ci=? "Straße" "STRASSE")  =>  #t
(string-ci=? "ΧΑΟΣ" "χαοσ")  =>  #t

The basic idea of these procedures is the same in all RnRS revisions. However, there are some differences.

R5RS and earlier reports only provided two-argument variants.

R6RS implementations are mainly the same, except that they may behave differently depending on which version of the Unicode standard they support.

R7RS implementations may lack support for some characters. The order is also implementation-defined, with lexicographical ordering only being one option.

This procedure can raise exceptions with the following condition types:
&assertion (R6RS)
The wrong number of arguments was passed or an argument was outside its domain.
R7RS
The assertions described above are errors. Implementations may signal an error, extend the procedure's domain of definition to include such arguments, or fail catastrophically.

string=?(3scm), string-foldcase(3scm)

R4RS, IEEE Scheme, R5RS, R6RS, R7RS

These procedures first appeared in R2RS.

This page is part of the scheme-manpages project. It includes materials from the RnRS documents. More information can be found at https://weinholt.se/scheme/manpages/.

2022-04-08