Question: I have the following method: /** * Read a line of text from standard input (the text terminal), * and return it as a set
I have the following method:
/** * Read a line of text from standard input (the text terminal), * and return it as a set of words. * * @return A set of Strings, where each String is one of the * words typed by the user */ public HashSet
String[] wordArray = inputLine.split(" "); // split at spaces
// add words from array into hashset HashSet
What I want to happen is just before the HashSet words is returned at the end of the statement, I want to iterate through the set and remove any common words. For example "the", "and", etc. How would I go about doing this?
Many thanks
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
