pub trait SplitCharFromStr<'a>: Sealed + Sized {
// Required methods
fn split_first_char(self) -> Option<(char, &'a str)>;
fn split_last_char(self) -> Option<(&'a str, char)>;
}Expand description
Extension trait that provides methods to split character from a &str.
Required Methods§
Sourcefn split_first_char(self) -> Option<(char, &'a str)>
fn split_first_char(self) -> Option<(char, &'a str)>
Split a string into a pair of first character and the rest.
assert_eq!("abc".split_first_char(), Some(('a', "bc")))Sourcefn split_last_char(self) -> Option<(&'a str, char)>
fn split_last_char(self) -> Option<(&'a str, char)>
Split a string into a pair of initial part and the last character.
assert_eq!("abc".split_last_char(), Some(("ab", 'c')))Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.