Skip to content

Instantly share code, notes, and snippets.

@mourawaldson
Created April 28, 2012 21:34
Show Gist options
  • Save mourawaldson/2522200 to your computer and use it in GitHub Desktop.
Save mourawaldson/2522200 to your computer and use it in GitHub Desktop.
Remove accents
import java.text.Normalizer;
/**
* Remove a acentuação de uma String.
*
* @param str
* @return String sem acentos.
*/
public static String removeAccents(String str) {
str = Normalizer.normalize(str, Normalizer.Form.NFD);
return str.replaceAll("[^\\p{ASCII}]", "");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment