Java String Accent equalsIgnoreAccents(String lhs, String rhs, Locale locale)

Here you can find the source of equalsIgnoreAccents(String lhs, String rhs, Locale locale)

Description

equals Ignore Accents

License

LGPL

Declaration

public static boolean equalsIgnoreAccents(String lhs, String rhs, Locale locale) 

Method Source Code

//package com.java2s;

import java.text.Collator;

import java.util.Locale;

public class Main {

    public static boolean equalsIgnoreAccents(String lhs, String rhs, Locale locale) {
        Collator collator = Collator.getInstance(locale);
        collator.setStrength(Collator.PRIMARY);
        int comparison = collator.compare(lhs, rhs);
        return (comparison == 0);
    }/* w  w w .  j a v a2 s  .c  om*/
}

Related

  1. deAccent(final @Nonnull String string)
  2. deAccent(String str)
  3. deAccent(String str)
  4. deAccent(String str)
  5. deleteAccents(String text)
  6. equalsIgnoreAccentsAndCase(String s1, String s2)
  7. equalsIgnoreCaseAndAccent(String string1, String string2, Locale locale)
  8. equalsStringIgnoringAccents(String str1, String str2)
  9. getDeAccentLoweredChars(String word)