0

I have a string:

C:\\tmp\\files\\file.xxx

How do I remove only one \?

End results:

C:\tmp\files\file.xxx
Biffen
  • 6,249
  • 6
  • 28
  • 36
Dominik
  • 99
  • 1
  • 11

1 Answers1

1

You might want to look at Python’s os.path module

Though if you would like to replace \\ with \, please do something like,

str = "C:\\tmp\\files\\file.xxx";
print str;

Output of above code will be,

C:\tmp\files\file.xxx

I've tested this code over here and it is working.

PPL
  • 6,357
  • 1
  • 11
  • 30