pub const fn is_char_boundary(string: &str, position: usize) -> bool
Expand description
Const equivalent of str::is_char_boundary
.
ยงExample
use konst::string::is_char_boundary;
let string = "้ is ๐ง ";
// Start of "้"
assert!(is_char_boundary(string, 0));
assert!(!is_char_boundary(string, 1));
assert!(!is_char_boundary(string, 2));
// start of " "
assert!(is_char_boundary(string, 3));
// start of "๐ง "
assert!(is_char_boundary(string, 7));
assert!(!is_char_boundary(string, 8));
// end of string
assert!(is_char_boundary(string, string.len()));
// after end of string
assert!(!is_char_boundary(string, string.len() + 1));