Trait MatchOccurrences

Source
pub trait MatchOccurrences {
    // Required methods
    fn find_matched_indices(&self, pat: &str) -> Vec<usize>;
    fn find_char_indices(&self, pat: char) -> Vec<usize>;
}
Expand description

Return the indices of all ocurrences of a string

Required Methods§

Source

fn find_matched_indices(&self, pat: &str) -> Vec<usize>

Return the indices only of all matches of a given string pattern (not a regular expression) Builds on match_indices in the Rust standard library

Source

fn find_char_indices(&self, pat: char) -> Vec<usize>

Match occurrences of a single character

Implementations on Foreign Types§

Source§

impl MatchOccurrences for str

Source§

fn find_matched_indices(&self, pat: &str) -> Vec<usize>

Return the indices only of all matches of a given regular expression

Source§

fn find_char_indices(&self, pat: char) -> Vec<usize>

As above, but with a character to avoid coercion

Implementors§