直接使用空字符串替换就可以了,如下: String b = "abcabcabc"; b=b.replace("b",""); Java String.replace()方法用法 返回一个新的字符串,用newChar替换此字符串中出现的所有oldChar