stringr (version 0.5)

str_replace_all: Replace all occurrences of a matched pattern in a string.

Description

Replace all occurrences of a matched pattern in a string.

Usage

str_replace_all(string, pattern, replacement)

Arguments

string
input character vector
pattern
pattern to look for, as defined by a POSIX regular expression. See the ``Extended Regular Expressions'' section of regex for details.
replacement
replacement string. References of the form <1>, <2> will be replaced with the contents of the respective matched group (created by ()) within the pattern. fruits <- c("one apple", "two pears", "th

Value

  • character vector.

Details

Vectorised over string, pattern and replacement. Shorter arguments will be expanded to length of longest.

See Also

gsub which this function wraps, str_replace_all to replace a single match