Java String Diacritics removeDiacritics(String input)

Here you can find the source of removeDiacritics(String input)

Description

remove Diacritics

License

Open Source License

Declaration

public static String removeDiacritics(String input) 

Method Source Code

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

import java.text.Normalizer;

public class Main {
    public static String removeDiacritics(String input) {
        String nrml = Normalizer.normalize(input, Normalizer.Form.NFD);
        StringBuilder stripped = new StringBuilder();
        for (int i = 0; i < nrml.length(); ++i) {
            if (Character.getType(nrml.charAt(i)) != Character.NON_SPACING_MARK) {
                stripped.append(nrml.charAt(i));
            }/*  ww w.j  a  v  a 2 s .  c  o m*/
        }
        return stripped.toString();
    }
}

Related

  1. removeDiacriticalMarks(String string)
  2. removeDiacriticals(final String s)
  3. removeDiacritics(String input)
  4. removeDiacritics(String st)
  5. removeDiacritics(String text)
  6. removeDiacritics(String word)