For the life of me, I am unable to strip out some escape characters from a text string (prior to further processing). I've tried stringi, gsub, but I just cannot get the correct syntax.
Here is my text string
txt <- "c(\"\\r\\n Stuff from a webpage: That I scraped using webcrawler\\r\\n\", \"\\r\\n \", \"\\r\\n \", \"\\r\\n \", \"\\r\\n\\r\\n \", \"\\r\\n\\r\\n \", \"\\r\\n \\r\\n \", \"\\r\\n \")"
I'd like to strip out "\\r\\n" from this string.
I've tried
gsub("[\\\r\\\n]", "", txt) (leaves me with "rn")
gsub("[\\r\\n]", "", txt) (leaves me without ANY r or n in the text)
gsub("[\r\n]", "", txt) (strips nothing)
How can I remove these characters? Bear in mind that this will need to work over other entries that may have normal words ending in "rn" or have "rn" in the middle somewhere!
Thanks!