4
This is so simple but I can’t find the answer! I would like to delete everything before the first occurrence of the word "that" in a string:
What am I doing:
v <- c("blabla que 1", "blabla que eu Boqueirão que")
gsub(".*que", "", v)
# [1] " 1" "irão"
The result I wanted was "1" and "I Boqueirão que" . when I try . * that the command has no effect. Thanks for your help!
If you give a space after
que
will work:gsub(".*que ", "", v)
. But there must be a more elegant solution than this.– Willian Vieira
this was an example, but the reality my bank is composed of several sentences where the "that" appears several times, so this solution does not work for me.
– Jessica Voigt