Description Usage Arguments Details Value TODO Examples
Wrapper of the stringi stri_replace_
family of functions.
1 | replace_in_string(string, from, to, squish_ws = FALSE)
|
string |
A character vector. |
from |
A string vector containing the patterns (regex, as string) to be matched. |
to |
A string vector of the replacements (element-wise) for |
squish_ws |
A boolean; determines if trailing white spaces and repeated whitespace inside a string (generated by the replacement), are trimmed or not. |
Given two vectors mapping the patterns to be replaced with their replacements, return a new string.
A character vector.
This is a bare bone implementation; dispatch to stringi functions will be implemented.
1 2 3 4 | string <- "Here, is a string: this is a test one."
from <- c("H.*,", ":", "\\.")
to <- c("", "", "")
replace_in_string(string, from, to)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.