Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

how to remove numbers from string java

Extract  numbers from a string

Character.isDigit(str.charAt(i))
Character.isLetter(str.charAt(i))
Character.isAlphabetic(str.charAt(i))

String password = "cnE4g1Z5y9A";	
String[] letters= password.split("[0-9]");    ==> cnEgZyA
String[] letters= password.split("[A-Za-z]");    ==> 4159
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #remove #numbers #string #java
ADD COMMENT
Topic
Name
7+5 =