Posted on

Collator

Performing Locale-Independent Comparisons

    Collator c = Collator.getInstance(new Locale("ru"));
    //c.setStrength(Collator.PRIMARY);
    System.out.println(c.compare("JOHN", "JOHN"));
    System.out.println(c.compare("JOHN", "John"));
    System.out.println(c.compare("JOHN", "john"));
    System.out.println("JOHN".compareTo("bill"));
Leave a Reply

Your email address will not be published. Required fields are marked *