Description Usage Arguments Details Value See Also Examples
This function counts the number of characters that falls into a given character class (e.g. letters, digits, or white spaces).
1 |
str |
character vector to search in |
pattern |
character vector; identifiers of character classes, see stringi-search-charclass |
Vectorized over str
and pattern
.
Returns an integer vector.
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
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.