从给定的文字中删除重音和变音符号。
// from n o w j a v a . c o m //package com.nowjava; import java.text.Normalizer; public class Main { /** * Removing accents and diacritics from given {@code text}. * * @param text * @return given {@code text} without accents and diacritics */ public static String removeAccents(String text) { if (text == null) { return null; } text = Normalizer.normalize(text, Normalizer.Form.NFD); return text.replaceAll("\\p{InCombiningDiacriticalMarks}+", ""); } }