I would like to squeeze out 'n' number of slashes into 1, where n is not fixed.
For example:
String path = "Report\\\\\\n";
Expected output : "Report\\n"
I tried the following way
System.out.println(path.replaceAll("\\+", "\");
But it's printing "Report\\\n"
I am not able to reduce more than that.
All the related so question/answer related to fixed number of slashes.
Is there any generic way I can squeeze all backslashes to one?