strs_replace | R Documentation |
strs_replace
replaces all occurrences of a specified substring in each
element of a character vector. It is similar to Python's str.replace()
method.
strs_replace(string, substring, replacement)
string |
A character vector where each element is a string in which to
replace |
substring |
The substring to be replaced. |
replacement |
The string to replace |
A character vector of the same length as string
, with substring
replaced by replacement
.
Python str.replace() documentation
strs_replace("hello world", "world", "there")
strs_replace("banana", "na", "mo")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.