Function first_char_of_utf8_string

Source
pub fn first_char_of_utf8_string(bytes: &[u8]) -> Result<(Vec<u8>, usize)>
Expand description

Return a character (or for invalid part of the string, the replacement character) of a UTF-8 string as bytes, as well as the number of input bytes consumed. For valid UTF-8 input, the number of input bytes will always match the number of output bytes.