Java String Accent equalsStringIgnoringAccents(String str1, String str2)

Here you can find the source of equalsStringIgnoringAccents(String str1, String str2)

Description

equals String Ignoring Accents

License

Open Source License

Declaration

public static boolean equalsStringIgnoringAccents(String str1,
            String str2) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

import java.text.Collator;

public class Main {
    public static boolean equalsStringIgnoringAccents(String str1,
            String str2) {/*from  w w  w .  j  a  v  a2 s.c o m*/
        final Collator instance = Collator.getInstance();

        // Ignore Accents
        instance.setStrength(Collator.NO_DECOMPOSITION);

        if (instance.compare(str1, str2) == 0) {
            return true;
        } else {
            return false;
        }
    }
}

Related

  1. deAccent(String str)
  2. deleteAccents(String text)
  3. equalsIgnoreAccents(String lhs, String rhs, Locale locale)
  4. equalsIgnoreAccentsAndCase(String s1, String s2)
  5. equalsIgnoreCaseAndAccent(String string1, String string2, Locale locale)
  6. getDeAccentLoweredChars(String word)
  7. normalizeByRemovingAccent(final String string)
  8. removeAccent(String s)
  9. removeAccent(String s)