I need to remove backslash ('\') from string in Python.
str2 = str1.replace('\', '') isn`t working.
How can i do it?
This is due to \ being the escape sequence character in python so you have to do \\
str2 = str1.replace('\\', '')
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With