pub trait StringUtils {
    // Required methods
    fn substr(&self, start: usize, length: usize) -> String;
    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) -> String

source

fn grapheme_len(&self) -> usize

Implementations on Foreign Types§

source§

impl StringUtils for String

source§

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

Takes a slice of the String, properly separated at Unicode grapheme boundaries. Returns a new String.

source§

fn grapheme_len(&self) -> usize

Counts the total number of Unicode graphemes in the String.

Implementors§