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 which
- equals char_pred, if it is character,
- satisifies the predicate char_pred, if it is a procedure,
- is in the set char_pred, if it is a character set.
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