strrep(s, old, new)
old
with new
in all strings
of character vector s
. The matching is case sensitive.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')
Run the code above in your browser using DataLab