www.delorie.com/gnu/docs/guile/guile_193.html   search  
 
Buy GNU books!


Guile Reference Manual

[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

21.4.7 String Comparison

The procedures in this section are similar to the character ordering predicates (see section 21.3 Characters), but are defined on character sequences. They all return #t on success and #f on failure. The predicates ending in -ci ignore the character case when comparing strings.

Scheme Procedure: string=? s1 s2
Lexicographic equality predicate; return #t if the two strings are the same length and contain the same characters in the same positions, otherwise return #f.

The procedure string-ci=? treats upper and lower case letters as though they were the same character, but string=? treats upper and lower case as distinct characters.

Scheme Procedure: string<? s1 s2
Lexicographic ordering predicate; return #t if s1 is lexicographically less than s2.

Scheme Procedure: string<=? s1 s2
Lexicographic ordering predicate; return #t if s1 is lexicographically less than or equal to s2.

Scheme Procedure: string>? s1 s2
Lexicographic ordering predicate; return #t if s1 is lexicographically greater than s2.

Scheme Procedure: string>=? s1 s2
Lexicographic ordering predicate; return #t if s1 is lexicographically greater than or equal to s2.

Scheme Procedure: string-ci=? s1 s2
Case-insensitive string equality predicate; return #t if the two strings are the same length and their component characters match (ignoring case) at each position; otherwise return #f.

Scheme Procedure: string-ci<? s1 s2
Case insensitive lexicographic ordering predicate; return #t if s1 is lexicographically less than s2 regardless of case.

Scheme Procedure: string-ci<=? s1 s2
Case insensitive lexicographic ordering predicate; return #t if s1 is lexicographically less than or equal to s2 regardless of case.

Scheme Procedure: string-ci>? s1 s2
Case insensitive lexicographic ordering predicate; return #t if s1 is lexicographically greater than s2 regardless of case.

Scheme Procedure: string-ci>=? s1 s2
Case insensitive lexicographic ordering predicate; return #t if s1 is lexicographically greater than or equal to s2 regardless of case.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

  webmaster     delorie software   privacy  
  Copyright 2003   by The Free Software Foundation     Updated Jun 2003