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


2.8.3.8 Prefixes and suffixes

Function: string-prefix-length str1 str2
Function: string-prefix-length str1 str2 start1
Function: string-prefix-length str1 str2 start1 end1
Function: string-prefix-length str1 str2 start1 end1 start2
Function: string-prefix-length str1 str2 start1 end1 start2 end2

Return the length of the longest common prefix of the two selected substrings strings. This is equivalent to the “mismatch index” for the strings (modulo the start index offsets).

Function: string-prefix-length-ci str1 str2
Function: string-prefix-length-ci str1 str2 start1
Function: string-prefix-length-ci str1 str2 start1 end1
Function: string-prefix-length-ci str1 str2 start1 end1 start2
Function: string-prefix-length-ci str1 str2 start1 end1 start2 end2

Case–insensitive variant.

Function: string-suffix-length str1 str2
Function: string-suffix-length str1 str2 start1
Function: string-suffix-length str1 str2 start1 end1
Function: string-suffix-length str1 str2 start1 end1 start2
Function: string-suffix-length str1 str2 start1 end1 start2 end2

Return the length of the longest common suffix of the two selected substrings strings.

Function: string-suffix-length-ci str1 str2
Function: string-suffix-length-ci str1 str2 start1
Function: string-suffix-length-ci str1 str2 start1 end1
Function: string-suffix-length-ci str1 str2 start1 end1 start2
Function: string-suffix-length-ci str1 str2 start1 end1 start2 end2

Case–insensitive variant.

Function: string-prefix? str1 str2
Function: string-prefix? str1 str2 start1
Function: string-prefix? str1 str2 start1 end1
Function: string-prefix? str1 str2 start1 end1 start2
Function: string-prefix? str1 str2 start1 end1 start2 end2

Return #t if the selected substring of str1 is a prefix of the selected substring of str2; otherwise return #f.

Function: string-prefix-ci? str1 str2
Function: string-prefix-ci? str1 str2 start1
Function: string-prefix-ci? str1 str2 start1 end1
Function: string-prefix-ci? str1 str2 start1 end1 start2
Function: string-prefix-ci? str1 str2 start1 end1 start2 end2

Case–insensitive variant.

Function: string-suffix? str1 str2
Function: string-suffix? str1 str2 start1
Function: string-suffix? str1 str2 start1 end1
Function: string-suffix? str1 str2 start1 end1 start2
Function: string-suffix? str1 str2 start1 end1 start2 end2

Return #t if the selected substring of str1 is a suffix of the selected substring of str2; otherwise return #f.

Function: string-suffix-ci? str1 str2
Function: string-suffix-ci? str1 str2 start1
Function: string-suffix-ci? str1 str2 start1 end1
Function: string-suffix-ci? str1 str2 start1 end1 start2
Function: string-suffix-ci? str1 str2 start1 end1 start2 end2

Case–insensitive variant.


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