我试图从某个字符串中删除特定单词使用功能replace()或replaceAll()但这些删除即使它是一个字的一部分,这个词的所有出现!
例:
String content = "is not like is, but mistakes are common";
content = content.replace("is", "");
Run Code Online (Sandbox Code Playgroud)
输出: "not like , but mtakes are common"
期望的输出: "not like , but mistakes are common"
我怎样才能只替换字符串中的整个单词?