-2
String newContent = oldContent.replace("\\", "\");

A windows path in a config file which is being modified by another program with \ After that i running this code to replace all \\ with \

John Joe
  • 12,412
  • 16
  • 70
  • 135
ajay
  • 9
  • 3

2 Answers2

0

try this:

 oldContent.replace("\\\\", "\\")
Ray
  • 3,864
  • 7
  • 24
  • 36
Diwakar Singh
  • 267
  • 3
  • 12
0
String newContent = oldContent.replace("\\\\", "\\");
Mahamudul Hasan
  • 2,745
  • 2
  • 17
  • 26