Compare accentuated letters : Collator « I18N « Java

Compare accentuated letters


import java.text.Collator;
import java.util.Locale;

public class Main {
  public static void main(String args[]) {

    String s1 = "";
    String s2 = "f";

    Collator frCollator = Collator.getInstance(Locale.FRANCE);
    if (, s2) < 0) {
        System.out.println("s1 < s2");
//s1 < s2


Related examples in the same category

1.Collator.getInstance(new Locale("sv", ""))
2.Comparing Half-Width and full-width A
6.Sort Collate
7.I18N SortI18N Sort
8.Searching, Sorting, and Text Boundary Detection: Collation IssuesSearching, Sorting, and Text Boundary Detection: Collation Issues
9.Check Equality for two strings with Collator
10.Sort strings using Collator class
11.I18N : TextI18N : Text