如程序:
String relPath = "C:/dafk/dfs/d";
relPath = relPath.replaceAll("/", "\\\\"); System.out.println(relPath);
为什么改成
relPath = relPath.replaceAll("/", "\\");救出错了呢?注:我需要的就是把/替换成\
String relPath = "C:/dafk/dfs/d";
relPath = relPath.replaceAll("/", "\\\\"); System.out.println(relPath);
为什么改成
relPath = relPath.replaceAll("/", "\\");救出错了呢?注:我需要的就是把/替换成\
事实上第二个也会作为正则式预处理一下,虽然没有实际意义附篇文章供参考
http://biostar.blog.sohu.com/69732830.html