Next: Alphabetic Case Mapping, Previous: String Comparison, Up: Strings
When searching for the index of a character in a string, these procedures can be used.
Search through the string s from left to right, returning the index of the first occurence of a character satisfying good, which must be one of:
- character ch
- The character is ch.
- predicate (procedure) p
- The character satisfies p.
- character set cset
- The character is in cset.
Like
string-index, but search from the right of the string rather than from the left. This procedure essentially implements therindexorstrrchrfunctions from the C library.(string-rindex "weiner" #\e) ⇒ 4 (string-rindex "weiner" #\e 2 4) ⇒ #f (string-rindex "weiner" #\e 2 5) ⇒ 4