Last active
July 10, 2023 15:32
-
-
Save marcosblandim/9dd3974a5158e181664bbfb65d54e9cb to your computer and use it in GitHub Desktop.
Remove accent from string in Java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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