Function voca_rs::count::count_words

source ·
pub fn count_words(subject: &str, pattern: &str) -> usize
Expand description

Counts the number of words in subject.

Arguments

  • subject - The string where to count.
  • pattern - The pattern to watch words.

Example

use voca_rs::*;
count::count_words("Gravity - can cross dimensions!", "");
// => 4
count::count_words("GravityCanCrossDimensions", "");
// => 4
count::count_words("Cafe\u{0301}-del-Mar-andBossaNova1", "-");
// => 4
use voca_rs::Voca;
"Gravity - can cross dimensions!"._count_words("");
// => 4