pub trait Between<'a> {
// Required methods
fn between(&self, delim: (&'_ str, &'_ str)) -> Option<&'a str>;
fn between_infallible(&self, delim: (&'_ str, &'_ str)) -> &'a str;
}Expand description
Slice a string between a pair of delimiters.
Required Methods§
Sourcefn between(&self, delim: (&'_ str, &'_ str)) -> Option<&'a str>
fn between(&self, delim: (&'_ str, &'_ str)) -> Option<&'a str>
Extract a string between the delimiters. If the delimiters were not found None is returned, otherwise the first extraction is returned.
Sourcefn between_infallible(&self, delim: (&'_ str, &'_ str)) -> &'a str
fn between_infallible(&self, delim: (&'_ str, &'_ str)) -> &'a str
Extract a string between the delimiters. If the delimiters were not found the original string is returned; take note of this behavior, if an empty slice is desired for this case use the fallible version and unwrap to EMPTY.