0

I have a string:

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

How do I remove only one \?

End results:

C:\tmp\files\file.xxx
Biffen
  • 5,791
  • 5
  • 29
  • 34
Dominik
  • 89
  • 1
  • 10

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,101
  • 1
  • 10
  • 28