Next: , Previous: SRFI-13 Comparison, Up: SRFI-13


39.11.8 Prefixes/Suffixes

Using these procedures you can determine whether a given string is a prefix or suffix of another string or how long a common prefix/suffix is.

— Scheme Procedure: string-prefix-length s1 s2 [start1 [end1 [start2 [end2]]]]

Return the length of the longest common prefix of the two strings.

— Scheme Procedure: string-prefix-length-ci s1 s2 [start1 [end1 [start2 [end2]]]]

Return the length of the longest common prefix of the two strings, ignoring character case.

— Scheme Procedure: string-suffix-length s1 s2 [start1 [end1 [start2 [end2]]]]

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

— Scheme Procedure: string-suffix-length-ci s1 s2 [start1 [end1 [start2 [end2]]]]

Return the length of the longest common suffix of the two strings, ignoring character case.

— Scheme Procedure: string-prefix? s1 s2 [start1 [end1 [start2 [end2]]]]

Is s1 a prefix of s2?

— Scheme Procedure: string-prefix-ci? s1 s2 [start1 [end1 [start2 [end2]]]]

Is s1 a prefix of s2, ignoring character case?

— Scheme Procedure: string-suffix? s1 s2 [start1 [end1 [start2 [end2]]]]

Is s1 a suffix of s2?

— Scheme Procedure: string-suffix-ci? s1 s2 [start1 [end1 [start2 [end2]]]]

Is s1 a suffix of s2, ignoring character case?