stringi (version 0.2-3)

stri_replace: Replace Occurrences of a Pattern

Description

A convenience function. Calls either stri_replace_all, stri_replace_first, or stri_replace_last, depending on the argument used.

Usage

stri_replace(str, replacement, ..., regex, fixed, coll, charclass,
  mode = c("first", "all", "last"))

Arguments

str
character vector of strings to search in
...
additional arguments passed to the underlying functions
regex
character vector; regular expressions
fixed
character vector; fixed patterns
coll
character vector; canonically equivalent patterns
charclass
character vector; identifiers of character classes
mode
string; whether to look for all, or only the first/last occurrence of the pattern
replacement
character vector of strings to replace with

Value

  • Returns a character vector.

Details

Note that this is slower than the direct call.

See Also

Other search_replace: stri_replace_all_charclass, stri_replace_first_charclass, stri_replace_first_charclass, stri_replace_last_charclass, stri_replace_last_charclass; stri_replace_all_coll, stri_replace_first_coll, stri_replace_first_coll, stri_replace_last_coll, stri_replace_last_coll; 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_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_na; stringi-search