借助 jdk Splace(CharSequence, CharSequence) 方法,实例: public static void main(String[] args){ //从 feitianbenyue 中移除 tian String str = "feitianbenyue"; String removeStr = "tian"; Sprintln(place(removeStr, "")); }输出:使用commons-lang3 StringUve(String, String),实例: public static void main(String[] args){ //从 feitianbenyue 中移除 tian String str = "feitianbenyue"; String removeStr = "tian"; //Sprintln(place(removeStr, "")); Sprintln(StringUve(str, removeStr)); } //输入同上