从字符串中删除特定单词
我正在尝试使用该函数从某个字符串中删除特定单词,或者这些删除该单词的所有出现次数,即使它是另一个单词的一部分!replace()
replaceAll()
例:
String content = "is not like is, but mistakes are common";
content = content.replace("is", "");
输出: "not like , but mtakes are common"
所需输出: "not like , but mistakes are common"
如何仅替换字符串中的整个单词?