Best way to check for all alphabetic, alphanumeric or numeri

Best way to check for all alphabetic, alphanumeric or numeri

Postby haretu » Wed Apr 13, 2011 8:55 pm

Code: Select all
if ("test%abc123".matches("[a-zA-Z]*")) { 
System.out.println("Pure alphabetic string"); 
} else { 
System.out.println("Not pure alphabets"); 
}
haretu
 
Posts: 132
Joined: Sat Jan 08, 2011 9:56 pm

Return to JAVA

Who is online

Users browsing this forum: No registered users and 1 guest

cron