Trait StringUtils

Source
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§

Source

fn substr(&self, start: usize, length: usize) -> &str

Creates a string slice from start and taking length, counted by grapheme clusters.

Source

fn grapheme_len(&self) -> usize

Counts the total number of Unicode graphemes in the String.

Implementations on Foreign Types§

Source§

impl StringUtils for str

Source§

fn substr(&self, start: usize, length: usize) -> &str

Source§

fn grapheme_len(&self) -> usize

Source§

impl StringUtils for String

Source§

fn substr(&self, start: usize, length: usize) -> &str

Source§

fn grapheme_len(&self) -> usize

Implementors§