Using R
I would like to get from a vector of strings all strings that end with _XXX
except those that have the word "Total" before _XXX
.
mystringvector <- c("str1_XXX","str2_XXY","str3_XXX","Total_XXX")
grep("*_XXX",mystringvector,value=TRUE)
The results should return only str1_XXX
and str3_XXX
. But how can I include the exception for Total_
.