pub trait StringUtils {
// Required methods
fn substr(&self, start: usize, length: usize) -> &str;
fn grapheme_len(&self) -> usize;
}
Expand description
Some helper functions for dealing with Unicode strings.
Required Methods§
Sourcefn substr(&self, start: usize, length: usize) -> &str
fn substr(&self, start: usize, length: usize) -> &str
Creates a string slice from start
and taking length
, counted by grapheme clusters.
Sourcefn grapheme_len(&self) -> usize
fn grapheme_len(&self) -> usize
Counts the total number of Unicode graphemes in the String.