hi!
how can i replace a string containing \ character with another chracter.
The replace function is not working as desired.
please help me out
regards,
LearnerOfPython
hi!
how can i replace a string containing \ character with another chracter.
The replace function is not working as desired.
please help me out
regards,
LearnerOfPython
Please show us what you are attempting so that we may assist you. Thanks.
hi!
how can i replace a string containing \ character with another chracter.
The replace function is not working as desired.
please help me out
regards,
LearnerOfPython
Use raw strings when working with the backward slash:
>>> s = r"C:\local\test\new"
>>> s.replace("\\",".")
'C:.local.test.new'
>>>