I am working in python and I need to convert this:
C:\\folderA\\folderB to C:/folderA/folderB
I have three approaches:
dir = s.replace(\'\\\\
To define the path's variable you have to add r
initially, then add the replace statement .replace('\\', '/')
at the end.
for example:
In>> path2 = r'C:\Users\User\Documents\Project\Em2Lph\'.replace('\\', '/')
In>> path2
Out>> 'C:/Users/User/Documents/Project/Em2Lph/'
This solution requires no additional libraries