<分区>
Possible Duplicate:
Wrong output using replaceall
如果我有字符串:
String test = "replace()thisquotes";
test = test.replaceAll("()", "");
测试结果还是:test = "replace()thisquotes"
so() 没有被替换。
有什么想法吗?
标签 java
<分区>
Possible Duplicate:
Wrong output using replaceall
如果我有字符串:
String test = "replace()thisquotes";
test = test.replaceAll("()", "");
测试结果还是:test = "replace()thisquotes"
so() 没有被替换。
有什么想法吗?
最佳答案
你不需要正则表达式,所以使用:
test.replace("()", "")
关于Java replaceAll函数的字符串不替换,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6135605/