Skip to main content

utf8_bounds

Function utf8_bounds 

Source
fn utf8_bounds(val: &str, start: i64, length: Option<usize>) -> (usize, usize)
Expand description

Returns the start and end byte offset of the substring of an arbitrary UTF-8 val.

  • start - the start char index of the substring, counted from the end if negative
  • length - the char length of the substring, or None to take the rest of val