Java Utililty Methods String Accent

List of utility methods to do String Accent

Description

The list of methods to do String Accent are organized into topic(s).

Method

StringstripAccents(final String s)

Remove accents

return Normalizer.normalize(s, Normalizer.Form.NFD).replaceAll("[\\p{InCombiningDiacriticalMarks}]", "");
StringstripAccents(String input)
Remove all accents of a string
return Normalizer.normalize(input, Normalizer.Form.NFD).replaceAll("\\p{InCombiningDiacriticalMarks}+", "");
StringstripAccents(String input)

Removes diacritics (~= accents) from a string.

if (input == null) {
    return null;
try {
    String result = null;
    if (java6Available) {
        result = removeAccentsJava6(input);
    } else if (sunAvailable) {
...
StringstripAccents(String input)
strip Accents
if (input == null) {
    return null;
final String decomposed = Normalizer.normalize(input, Normalizer.Form.NFD);
String stripped = findAccentsPattern.matcher(decomposed).replaceAll("");
for (Map.Entry<Character, Character> e : visualEquivalents.entrySet()) {
    stripped = stripped.replace(e.getKey(), e.getValue());
return stripped;
StringstripAccents(String v)
strip Accents
if (v != null) {
    String s = Normalizer.normalize(v, Normalizer.Form.NFD);
    return s.replaceAll("\\p{M}", "");
} else {
    return null;
StringstripAccentsToLowerCase(String str)
Remove all accents in the string provided.
return stripAccents(str).toLowerCase();
StringtoLatinUnaccented(String s)
Converts a string with cyrillic text to unaccented latin.
return removeAccents(toLatin(s));
StringtoUnaccented(String s)
Normalize string by removing diacritical marks.
return COMBINING_DIACRIT_PAT.matcher(Normalizer.normalize(s, Form.NFD)).replaceAll("");