Next: , Previous: , Up: strings   [Index]


25.5 Predicates

Function: string-null? obj

Return #t if obj is the empty string, otherwise return #f.

Function: %string-every char/char-set/pred str start past
Function: %string-any char/char-set/pred str start past
Macro: string-every char/char-set/pred S
Macro: string-any char/char-set/pred S

Check to see if the given criteria is true on every/any character in str, proceeding from left (index start) to right (index past).

If the selected substring is empty, the return value is #f.

If char/char-set/pred is a character, it is tested for equality with the elements of S.

If char/char-set/pred is a character set, the elements of S are tested for membership in the set.

If char/char-set/pred is a predicate procedure, it is applied to the elements of S. The predicate is “witness–generating”:

If the predicate is applied to the final element of the selected substring, that final application is a tail call.

The names of these procedures do not end with a question mark; this is to indicate that, in the predicate case, they do not return a simple boolean (#t or #f), but a general value.