Created
February 13, 2020 11:57
-
-
Save neilsonlima/a80d4dfdd0748ea092ae03b4decb9799 to your computer and use it in GitHub Desktop.
Substitui os caracteres com acento por caracteres sem
This file contains 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 class ExemploSubstring { | |
public static void main(String[] args) { | |
String str = "Caiô sérgio evidência saída"; | |
str = Normalizer.normalize(str, Normalizer.Form.NFD); | |
str = str.replaceAll("[^\\p{ASCII}]", ""); | |
System.out.println(str); # Caio sergio evidencia saida | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
import java.text.Normalizer;
public class ExemploSubstring {
}