String path = “E:\testFile\product”;
System.out.println("path是:"+path);
String newpath=path.replaceAll("\\\\","\\\\\\\\");
System.out.println("新的路径:"+newpath);
替换后输出之后的路径是:E:\\testFile\\product
转载于:https://blog.51cto.com/roley/1302406
String path = “E:\testFile\product”;
System.out.println("path是:"+path);
String newpath=path.replaceAll("\\\\","\\\\\\\\");
System.out.println("新的路径:"+newpath);
替换后输出之后的路径是:E:\\testFile\\product
转载于:https://blog.51cto.com/roley/1302406