I would like to remove multiple words from a string in R, but would like to use a character vector instead of a regexp.
For example, if I had the string
"hello how are you"
and wanted to remove
c("hello", "how")
I would return
" are you"
I can get close with str_remove()
from stringr
"hello how are you" %>% str_remove(c("hello","how"))
[1] "how are you" "hello are you"
But I'd need to do something to get this down into a single string. Is there a function that does all of this on one call?