Sort List of Strings with Localization

You can use a sort with a custom Comparator. See the Collator interface

Collator coll = Collator.getInstance(locale);
coll.setStrength(Collator.PRIMARY);
Collections.sort(words, coll);

The collator is a comparator and can be passed directly to the Collections.sort(...) method.

Leave a Comment