![]() |
#2
疯狂的小a2018-04-24 20:41
|
代码:
String strPath = "/test/";
System.out.println(strPath);
File file = new File(strPath);
System.out.println(file.getCanonicalPath().replaceAll("\\\\", "/"));
控制台输出:
/test/
/test2