I need to remove backslash ('\') from string in Python.
'\'
str2 = str1.replace('\', '') isn`t working.
str2 = str1.replace('\', '')
How can i do it?
This is due to \ being the escape sequence character in python so you have to do \\
str2 = str1.replace('\\', '')