Skip to main content

split_prefix_u16

Function split_prefix_u16 

Source
fn split_prefix_u16<'a, 'b>(
    left: &'a [u16],
    right: &'b [u16],
) -> (&'a [u16], &'a [u16], &'b [u16])
Expand description

Finds the identical prefix of left and right containing potentially ill-formed UTF-16, while avoiding splitting a well-formed surrogate pair. In case of ill-formed UTF-16, the prefix is not guaranteed to be maximal.

Returns the identical prefix, the part of left after the prefix, and the part of right after the prefix.