Function byte_position_of_char

Source
pub fn byte_position_of_char(str: &String, index: usize) -> Option<usize>
Expand description

Get the starting position of a character in a string.

When working with unicode characters a character can span multiple bytes and thus the offset of characters is not the same as the number of bytes.