stri_replace_charclass: Replace Occurrences of a Character Class

Description Usage Arguments Details Value See Also Examples

Description

Replaces with the given replacement string every/first/last character class occurrence in the input string.

Usage

1
2
3
4
5

Arguments

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

Details

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.

Value

character vector

See Also

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

Examples

1
stri_replace_all_charclass("a\nb\tc d", "WHITE_SPACE", " ")

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