This should work:
String path = "C:\\system/properties\\\\all//";
Edit: changed contents of assylias response content
System.out.println(path.replaceAll("(\\\\+|/+)", Matcher.quoteReplacement(System.getProperty("file.separator"))));
End of editing
Output (for me - I use mac):
C:/system/properties/all/
Thus, it "normalizes" the double delimiters.
source share