Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save diogoalexsmachado/b8acb41e0dffdc4c743aa8e028a9b0ca to your computer and use it in GitHub Desktop.
Save diogoalexsmachado/b8acb41e0dffdc4c743aa8e028a9b0ca to your computer and use it in GitHub Desktop.
remove chars string in java
String nome= userDao.getNomeCompleto(2L);
String nomeFiltered="";
for (int i=0;i<str.length();i++) {
//only allows letters from ASCII value
if (str.charAt(i)>64 && str.charAt(i)<=122) {
nomeFiltered=nomeFiltered+str.charAt(i);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment