pub trait StringExt {
    // Required methods
    fn char_count(&self) -> u32;
    fn char_index(&self, offset: u32) -> usize;
    fn char_slice(&self, start: u32, end: u32) -> &str;
    fn char_slice_from(&self, start: u32) -> &str;
}
Expand description

Extension trait that adds methods used for working with Strings and &strs in terms of their UTF-8 characters, as opposed to bytes

Required Methods§

source

fn char_count(&self) -> u32

source

fn char_index(&self, offset: u32) -> usize

source

fn char_slice(&self, start: u32, end: u32) -> &str

source

fn char_slice_from(&self, start: u32) -> &str

Implementors§

source§

impl<S> StringExt for S
where S: AsRef<str>,