I'm using HashMap to count all word instances in an article, I'm trying to remove all non-word characters except spaces(because they're already removed with .split()). Is there a way to not repeat "pWord = pWord.replace(...);" every time and instead loop through and pass different arguments inside parentheses?
pWord = pWord.replace('"', '\"');
pWord = pWord.replace("–", "");
pWord = pWord.replace("\"", "");
pWord = pWord.replace(".", "");
pWord = pWord.replace("-", "");