Java String Accent deAccent(String str)

Here you can find the source of deAccent(String str)

Description

de Accent

License

Open Source License

Declaration

public static String deAccent(String str) 

Method Source Code


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

import java.text.Normalizer;

import java.util.regex.Pattern;

public class Main {
    public static String deAccent(String str) {
        if (str == null)
            return null;

        String nfdNormalizedString = Normalizer.normalize(str, Normalizer.Form.NFD);
        Pattern pattern = Pattern.compile("\\p{InCombiningDiacriticalMarks}+");
        return pattern.matcher(nfdNormalizedString).replaceAll("");
    }//w ww .  jav a  2  s .  c o  m
}

Related

  1. compareIgnoreCaseAndAccent(String string1, String string2, Locale locale)
  2. deAccent(final @Nonnull String string)
  3. deAccent(String str)
  4. deAccent(String str)
  5. deleteAccents(String text)
  6. equalsIgnoreAccents(String lhs, String rhs, Locale locale)