Skip to main content

SplitInfallible

Trait SplitInfallible 

Source
pub trait SplitInfallible<'a> {
    // Required methods
    fn split_once_infallible(&self, delim: &str) -> (&'a str, &'a str);
    fn rsplit_once_infallible(&self, delim: &str) -> (&'a str, &'a str);
}
Expand description

Split a string with default behaviors on non-match.

Required Methods§

Source

fn split_once_infallible(&self, delim: &str) -> (&'a str, &'a str)

Split a string at the first occurrence of delim. If not found, the entire string is returned in [0], while [1] is empty.

Source

fn rsplit_once_infallible(&self, delim: &str) -> (&'a str, &'a str)

Split a string from the last occurrence of delim. If not found, the entire string is returned in [0], while [1] is empty.

Implementations on Foreign Types§

Source§

impl<'a> SplitInfallible<'a> for &'a str

Source§

fn rsplit_once_infallible(&self, delim: &str) -> (&'a str, &'a str)

Source§

fn split_once_infallible(&self, delim: &str) -> (&'a str, &'a str)

Implementors§