I have a string like so:
>>> t
\'\\\\u0048\\\\u0065\\\\u006c\\\\u006c\\\\u006f\\\\u0020\\\\u20ac\\\\u0020\\\\u00b0\'
That I made u
You only got one backslash in your code, but backslashes are represent as \\
. As you can see, when you use print()
, there's only one backslash. So if you want to get rid of one of the two backslashes, don't do anything, it's not there. If you wanna get rid of both, just remove one. Again use \\
to represent one backslash: t.replace("\\", "")
So your string never has two backslashes in the first place, it shouldn't be the problem.