In Python you can use raw strings:
import re
re.sub(r"\\", ":", "back\\slash") # r"\\" instead of "\\\\"
Does this exist in R as well? For example, here is an equivalent code snippet without raw strings in R:
library(stringr)
str_replace("back\\slash", "\\\\", ":")
I would love to be able to do this:
str_replace("back\\slash", raw("\\"), ":")
Does this functionality already exist, or should I just implement my own function raw()
?