Suppose my string is:
\' Hai Hello\\nGood eve\\n\'
How do I eliminate the \'\\n\' in between and make a string print like :
\'\\n\'
You can use the replace method:
replace
>>> a = "1\n2" >>> print a 1 2 >>> a = a.replace("\n", " ") >>> print a 1 2