stri_count_charclass: Count the Number of Character Class Matches

Description Usage Arguments Details Value See Also Examples

Description

This function counts the number of characters that falls into a given character class (e.g. letters, digits, or white spaces).

Usage

1

Arguments

str

character vector to search in

pattern

character vector; identifiers of character classes, see stringi-search-charclass

Details

Vectorized over str and pattern.

Value

Returns an integer vector.

See Also

Other search_charclass: stri_detect_charclass; stri_extract_all_charclass, stri_extract_all_charclass, stri_extract_first_charclass, stri_extract_first_charclass, stri_extract_last_charclass, stri_extract_last_charclass; stri_locate_all_charclass, stri_locate_all_charclass, stri_locate_first_charclass, stri_locate_first_charclass, stri_locate_last_charclass, stri_locate_last_charclass; stri_replace_all_charclass, stri_replace_all_charclass, stri_replace_first_charclass, stri_replace_first_charclass, stri_replace_last_charclass, stri_replace_last_charclass; stri_split_charclass, stri_split_charclass; stri_trim, stri_trim, stri_trim_both, stri_trim_left, stri_trim_right; stringi-search-charclass; stringi-search

Other search_count: stri_count_fixed; stri_count_regex; stri_count; stringi-search

Examples

1
2
3
stri_count_charclass(c("stRRRingi","REXAMINE","123"), c("Ll", "Lu", "Zs"))
stri_count_charclass(" \t\n", "WHITE_SPACE") # white space - binary property
stri_count_charclass(" \t\n", "Z") # whitespace - general category (note the difference)

stringi documentation built on May 2, 2019, 4:54 p.m.