Counts the number of words in each element of a character vector.
Details
Words are detected using Unicode-aware word boundaries as implemented in stringi. This ensures robust handling of different languages, punctuation, and whitespace.
See also
string-overview for an overview of all string utilities in pharos.
Examples
strCountW("This is a sentence.")
#> [1] 4
strCountW(c("One word", "Two words here", NA))
#> [1] 2 3 NA
