public class Test {
public static void main(String[] args) {
// TODO Auto-generated method stub
String webPath = "\\"+"upload"+"\\"+"ddd";
System.out.println(webPath);
webPath = webPath.replaceAll("\\\\", "/");
System.out.println(webPath);
}
}
运行结果
\upload\ddd
/upload/ddd