Do you mean you want to have just one copy of each word ie remove all duplicates?
Joined: Mar 22, 2008
Thanks Tony Docherty for your favorable reply
Yes exactly I need this
Joined: Aug 07, 2007
If you don't need to maintain any ordering put all the strings into HashSet, if the order needs to be maintained use a LinkedHashSet.
You will need to trim each of the strings returned from split unless you can guarantee there are no spurious white spaces in the original string you are splitting.