len_of_first_n_code_units

Function len_of_first_n_code_units 

Source
fn len_of_first_n_code_units(
    text: &DOMString,
    n: Utf16CodeUnitLength,
) -> Utf8CodeUnitLength
Expand description

The length in bytes of the first n code units in a string when encoded in UTF-16.

If the string is fewer than n code units, returns the length of the whole string.