pub fn byte_index_for_char(s: &str, ci: usize) -> usizeExpand description
What: Convert a character index to a byte index for slicing.
Input: s source string; ci character index
Output: Byte index into s corresponding to ci
Details: Returns 0 for ci==0; returns s.len() when ci>=char_count(s); otherwise maps
the character index to a byte offset via char_indices().