pub fn char_to_byte(s: &str, char_idx: usize) -> usizeExpand description
Converts a char-indexed position in s to its byte offset.
Returns s.len() if char_idx is past the end, making it safe to use
directly with String::insert and String::remove.