Description Usage Arguments Details Value See Also Examples
Replaces with the given replacement string every/first/last character class occurrence in the input string.
1 2 3 4 5 | stri_replace_all_charclass(str, pattern, replacement)
stri_replace_first_charclass(str, pattern, replacement)
stri_replace_last_charclass(str, pattern, replacement)
|
str |
character vector with strings to search in |
pattern |
character vector; identifiers of character classes, see stringi-search-charclass |
replacement |
character vector of strings to replace with |
Vectorized over str
, pattern
, and
replacement
.
These functions scan the input string for matches of a character class. Input that is not part of any match is left unchanged; each match is replaced in the result by the same (fixed) replacement string.
character vector
Other search_charclass: stri_count_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_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_replace: stri_replace_all_fixed
,
stri_replace_all_fixed
,
stri_replace_first_fixed
,
stri_replace_first_fixed
,
stri_replace_last_fixed
,
stri_replace_last_fixed
;
stri_replace_all_regex
,
stri_replace_all_regex
,
stri_replace_first_regex
,
stri_replace_first_regex
,
stri_replace_last_regex
,
stri_replace_last_regex
;
stri_replace_all
;
stri_replace_first
;
stri_replace_last
;
stri_replace
; stringi-search
1 | stri_replace_all_charclass("a\nb\tc d", "WHITE_SPACE", " ")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.