Skip to main content

whole_word_matches

Function whole_word_matches 

Source
pub fn whole_word_matches<'a>(
    text: &'a str,
    needle: &'a str,
) -> impl Iterator<Item = (usize, usize)> + 'a
Expand description

Byte ranges of the occurrences of needle in text that don’t start or end inside a word. An end of needle that isn’t a word character (as in “C++”) needs no word boundary.