今天做了一个替换字符串中的括号,发现需要使用转义字符,所以就记录一下。 //替换字符串中的括号 String str = "aaaaa(bbbb)cccc"; str.replaceAll("\\(",""); str.replaceAll("\\)","");