I have a string x as below. I am trying to replace "c("" and "\nLOC" such that I am left with only Abc,xyz.
x<-"c(\"Abc, xyz\\nLOC"
This is what I tried which works but is there a shorter way of doing it?
x <-str_replace_all(x, "[^[:alnum:]]", " ")
x <-str_replace_all(x, "c ", "")
x <-str_replace_all(x, "nLOC", "")