Skip to content

Instantly share code, notes, and snippets.

@marcosblandim
Last active July 10, 2023 15:32
Show Gist options
  • Select an option

  • Save marcosblandim/9dd3974a5158e181664bbfb65d54e9cb to your computer and use it in GitHub Desktop.

Select an option

Save marcosblandim/9dd3974a5158e181664bbfb65d54e9cb to your computer and use it in GitHub Desktop.
Remove accent from string in Java
import java.text.Normalizer;
public String unaccent(String str) {
return Normalizer.normalize(src, Normalizer.Form.NFD).replaceAll("[^\\p{ASCII}]", "");
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment