strRep | R Documentation |
Find and replace all occurrences of a substring with another one in all strings of a character vector.
strRep(s, old, new)
s |
Character vector. |
old |
String to be replaced. |
new |
String that replaces another one. |
Replaces all occurrences of old
with new
in all strings
of character vector s
. The matching is case sensitive.
A character vector of the same length.
gsub
, regexprep
S <- c('This is a good example.', "He has a good character.",
'This is good, good food.', "How goodgood this is!")
strRep(S, 'good', 'great')
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.