Next: , Previous: External Representation of Characters, Up: Characters


5.2 Comparison of Characters

— procedure: char=? char1 char2
— procedure: char<? char1 char2
— procedure: char>? char1 char2
— procedure: char<=? char1 char2
— procedure: char>=? char1 char2
— procedure: char-ci=? char1 char2
— procedure: char-ci<? char1 char2
— procedure: char-ci>? char1 char2
— procedure: char-ci<=? char1 char2
— procedure: char-ci>=? char1 char2

Returns #t if the specified characters are have the appropriate order relationship to one another; otherwise returns #f. The -ci procedures don't distinguish uppercase and lowercase letters.

Character ordering follows these portability rules:

MIT/GNU Scheme uses a specific character ordering, in which characters have the same order as their corresponding integers. See the documentation for char->integer for further details.

Note: Although character objects can represent all of Unicode, the model of alphabetic case used covers only ASCII letters, which means that case-insensitive comparisons and case conversions are incorrect for non-ASCII letters. This will eventually be fixed.