[][src]Function voca_rs::count::count_words

pub fn count_words(subject: &str, pattern: &str) -> usize

Counts the number of words in subject.

Arguments

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