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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started