Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public void removeAllDuplicates()
- {
- String train = " ";
- int i = 1;
- train = train + words.get(0) + " ";
- while(i<words.size()){
- String test = " " + words.get(i) + " ";
- if(train.contains(test)){
- words.remove(i);
- }
- else
- {
- train = train + words.get(i) + " ";
- i++;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement