public static String transformPath(String path) {
String regex = “/+”;
String regex1 = “\\+”;
return path.replaceAll(regex, “/”).replaceAll(regex1, “/”);
}
java 将目录中多个斜杠转换为1个
最新推荐文章于 2024-07-03 02:53:25 发布
public static String transformPath(String path) {
String regex = “/+”;
String regex1 = “\\+”;
return path.replaceAll(regex, “/”).replaceAll(regex1, “/”);
}