Skip to main content

try_decode_char

Function try_decode_char 

Source
pub const fn try_decode_char(
    bytes: &[u8],
    i: &mut usize,
) -> Result<Option<(char, u8)>, Utf8Error>
Expand description

Read the UTF-8 encoded character out of the given slice at position i.

Returns the character and its encoded byte length, moving the i value to point to the start of the next character (or end of string).