字符串转议问题"\".(没分了就给50吧)
public class Ttt {
public Ttt() {
String str = "1111111111\11111111111111";
System.out.println(str.replaceAll("\\", "\\\\"));
}
public static void main(String[] args) {
Ttt t = new Ttt();
}
}
怎么样才能让程序输出:1111111111\11111111111111
正则表达式replaceAll("\\","\\\\")来替换可以编译但执行错误.