Computer >> Computer tutorials >  >> Programming >> Python

How to replace backward \ slash from a string


In Python it does give the desired result

>>> var  = "aaa\\bbb\\ccc and ddd\\eee"
>>> var.split('\\')
['aaa', 'bbb', 'ccc and ddd', 'eee']