char boundary
A byte position where one character ends and the next begins.
A char boundary is a byte index at the start of a char, or the string's length; str slicing panics unless both ends are char boundaries (is_char_boundary checks one).
Loading interactive…
Examples
In
"héllo", byte 2 falls insideé, so&s[0..2]panics whiles.get(0..2)returnsNone.