Next: Regular Expressions, Previous: Searching Strings, Up: Strings [Contents][Index]
Compares the two strings (substrings), starting from the beginning, and
returns the number of characters that are the same. If the two strings
(substrings) start differently, returns 0. The -ci
procedures
don’t distinguish uppercase and lowercase letters.
(string-match-forward "mirror" "micro") ⇒ 2 ; matches "mi" (string-match-forward "a" "b") ⇒ 0 ; no match
Compares the two strings (substrings), starting from the end and
matching toward the front, returning the number of characters that are
the same. If the two strings (substrings) end differently, returns 0.
The -ci
procedures don’t distinguish uppercase and lowercase
letters.
(string-match-backward-ci "BULBOUS" "fractious")
⇒ 3 ; matches "ous"
These procedures return #t
if the first string (substring) forms
the prefix of the second; otherwise returns #f
. The -ci
procedures don’t distinguish uppercase and lowercase letters.
(string-prefix? "abc" "abcdef") ⇒ #t (string-prefix? "" any-string) ⇒ #t
These procedures return #t
if the first string (substring) forms
the suffix of the second; otherwise returns #f
. The -ci
procedures don’t distinguish uppercase and lowercase letters.
(string-suffix? "ous" "bulbous") ⇒ #t (string-suffix? "" any-string) ⇒ #t
Next: Regular Expressions, Previous: Searching Strings, Up: Strings [Contents][Index]