I have a string that is a sentence like I don't want it, there'll be others
So the text looks like this: I don\'t want it, there\'ll be other
for some reason a \
comes with the text next to '
. This has been read from another source. I want to delete it, but I can’t. I tried.
sentence.replace("\'","'")
sentence.replace(r"\'","'")
sentence.replace("\\","")
sentence.replace(r"\\","")
sentence.replace(r"\\\\","")
I know I have \
to avoid something, so I'm not sure how to do this with quotation marks
jason source
share