java - Alphabetical sort arraylist -


i have string arraylist, need sort list in alphabetical order. logic needs ignore lowercase versus uppercase, punctuation (e.g. periods, dashes).

example: incorrect: t-ext, tabc (text), te text

correct: tabc (text), t-ext, te text

first iterate through list , rid of character dont want part of ordering. second call sort on collection, or collections.sort(list,comparator) custom comparator. can rid of unwanted characters in comparator method if want keep original is.


Comments