Remove a specific word from a string
What the heck,
String regex = "\\s*\\bis\\b\\s*";
content = content.replaceAll(regex, "");
Remember you need to use replaceAll(...)
to use regular expressions, not replace(...)
\\b
gives you the word boundaries\\s*
sops up any white space on either side of the word being removed (if you want to remove this too).
content = content.replaceAll("\\Wis\\W|^is\\W|\\Wis$", "");