[][src]Function persistent_rope::char_to_byte_index

pub fn char_to_byte_index(string: &str, char_index: usize) -> usize

Examples

use persistent_rope::char_to_byte_index;
assert_eq!(char_to_byte_index("長さ", 0), 0);
assert_eq!(char_to_byte_index("長さ", 1), 3);
assert_eq!(char_to_byte_index("長さ", 2), 6);