JAVA String 如何去掉指定字符串 public static void main(String[] args) throws Exception { String str=",2004a05,2004a06,2004a08"; String shan=",2004a06"; System.out.println(str.replace(shan, "")); //输出结果,2004a05,2004a08 }