This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Java in General and the fly likes Character Problem! Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Character Problem!" Watch "Character Problem!" New topic

Character Problem!

Zafar Ali
Ranch Hand

Joined: May 11, 2002
Posts: 64
Can any one help me ...
how can takes a character as input and then classify it.
(Hint A-Z (65-90), a-z(97-122) and 0-9 (48-57).
Norm Miller
Ranch Hand

Joined: May 21, 2002
Posts: 56
Try this!
char cc = '9'; // just for testing
if (Character.isLowerCase(cc))
System.out.println(" Lower case ");
if (Character.isUpperCase(cc))
System.out.println(" Upper case ");
if (Character.isDigit(cc))
System.out.println(" Digit ");
// getType also works
It is sorta covered in the JavaRanch Style Guide.
subject: Character Problem!
Similar Threads
Using contains/equals/== with random characters?
Read rest of the string with Scanner class
Delete Special Charecters form the String
Re: password policy
Legel Identifiers