Trait StrUtils

Source
pub trait StrUtils {
    // Required methods
    fn contains_all<'a, I>(&self, parts: I) -> bool
       where I: IntoIterator<Item = &'a str>;
    fn contains_any<'a, I>(&self, parts: I) -> bool
       where I: IntoIterator<Item = &'a str>;
    fn to_title_case(&self) -> String;
}
Expand description

Extra methods for string slices (&str).

Required Methods§

Source

fn contains_all<'a, I>(&self, parts: I) -> bool
where I: IntoIterator<Item = &'a str>,

Returns true if all strings in the iterator exist in the main string.

Source

fn contains_any<'a, I>(&self, parts: I) -> bool
where I: IntoIterator<Item = &'a str>,

Returns true if any of the strings in the iterator exist in the main string.

Source

fn to_title_case(&self) -> String

Returns a new string with the first letter capitalized.

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.

Implementations on Foreign Types§

Source§

impl StrUtils for str

Source§

fn contains_all<'a, I>(&self, parts: I) -> bool
where I: IntoIterator<Item = &'a str>,

Source§

fn contains_any<'a, I>(&self, parts: I) -> bool
where I: IntoIterator<Item = &'a str>,

Source§

fn to_title_case(&self) -> String

Implementors§