Skip to content

Instantly share code, notes, and snippets.

@basarik
Last active February 18, 2016 13:05
Show Gist options
  • Save basarik/475867366488ef5abe10 to your computer and use it in GitHub Desktop.
Save basarik/475867366488ef5abe10 to your computer and use it in GitHub Desktop.
Android Collection sort by Turkish chracters
Collections.sort(stringList, new Comparator<String>() {
@Override
public int compare(String lhs, String rhs) {
final Collator collator = Collator.getInstance(new Locale("tr_TR"));
return collator.compare(lhs.toUpperCase(), rhs.toUpperCase()); // toUpperCase to avoid a dotless i problem (was at the end)
}
});
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment