Next: , Previous: , Up: bytevectors 8   [Index]


27.2.12 Prefixes and suffixes

Function: %bytevector-s8-prefix-length bv1 start1 past1 bv2 start2 past2
Function: %bytevector-u8-prefix-length bv1 start1 past1 bv2 start2 past2
Function: %bytevector-s8-prefix-length-ci bv1 start1 past1 bv2 start2 past2
Function: %bytevector-u8-prefix-length-ci bv1 start1 past1 bv2 start2 past2
Macro: bytevector-s8-prefix-length B1 B2
Macro: bytevector-u8-prefix-length B1 B2
Macro: bytevector-s8-prefix-length-ci B1 B2
Macro: bytevector-u8-prefix-length-ci B1 B2

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

Function: %bytevector-s8-suffix-length bv1 start1 past1 bv2 start2 past2
Function: %bytevector-u8-suffix-length bv1 start1 past1 bv2 start2 past2
Function: %bytevector-s8-suffix-length-ci bv1 start1 past1 bv2 start2 past2
Function: %bytevector-u8-suffix-length-ci bv1 start1 past1 bv2 start2 past2
Macro: bytevector-s8-suffix-length B1 B2
Macro: bytevector-u8-suffix-length B1 B2
Macro: bytevector-s8-suffix-length-ci B1 B2
Macro: bytevector-u8-suffix-length-ci B1 B2

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

Function: %bytevector-s8-prefix? bv1 start1 past1 bv2 start2 past2
Function: %bytevector-u8-prefix? bv1 start1 past1 bv2 start2 past2
Function: %bytevector-s8-prefix-ci? bv1 start1 past1 bv2 start2 past2
Function: %bytevector-u8-prefix-ci? bv1 start1 past1 bv2 start2 past2
Macro: bytevector-s8-prefix? B1 B2
Macro: bytevector-u8-prefix? B1 B2
Macro: bytevector-s8-prefix-ci? B1 B2
Macro: bytevector-u8-prefix-ci? B1 B2

Return #t if the subvector B1 is a prefix of the subvector B2, otherwise return #f. Notice that the empty bytevector is a prefix of every bytevector.

Function: %bytevector-s8-suffix? bv1 start1 past1 bv2 start2 past2
Function: %bytevector-u8-suffix? bv1 start1 past1 bv2 start2 past2
Function: %bytevector-s8-suffix-ci? bv1 start1 past1 bv2 start2 past2
Function: %bytevector-u8-suffix-ci? bv1 start1 past1 bv2 start2 past2
Macro: bytevector-s8-suffix? B1 B2
Macro: bytevector-u8-suffix? B1 B2
Macro: bytevector-s8-suffix-ci? B1 B2
Macro: bytevector-u8-suffix-ci? B1 B2

Return #t if the subvector B1 is a suffix of the subvector B2, otherwise return #f. Notice that the empty bytevector is not a suffix of every bytevector.


Next: , Previous: , Up: bytevectors 8   [Index]