File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Java in General and the fly likes splitting and comparing splitted Strings Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "splitting and comparing splitted Strings" Watch "splitting and comparing splitted Strings" New topic
Author

splitting and comparing splitted Strings

Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Hello,



I am trying to read unique data by removing similar values in array after splitting it but unable to go a head. Please advise

Thanks in anticipation
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 1934
    
  28
Do you mean you want to have just one copy of each word ie remove all duplicates?
Farakh khan
Ranch Hand

Joined: Mar 22, 2008
Posts: 726
Thanks Tony Docherty for your favorable reply

Yes exactly I need this
Tony Docherty
Bartender

Joined: Aug 07, 2007
Posts: 1934
    
  28
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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: splitting and comparing splitted Strings
 
Similar Threads
trying to find union/intersection of arrays containing integers
How to set value in jtable fields??
MultiDimenaional Array sort
Print String from an Array
java.lang.illegalstate exception