![]() |
The Java Developers Almanac 1.4Order this book from Amazon. |
e305. Determining the Type of a CharacterYou should use the methods in the classCharacter to determine
the properties of a character. These methods work for the entire
Unicode character set.
char ch = 'a'; if (Character.isLetter(ch)) { // true } if (Character.isDigit(ch)) { // false } if (Character.isLowerCase(ch)) { // true } if (Character.isUpperCase(ch)) { // false } // See Character for more methods.
e307. Iterating the Characters of a String e308. Adding an Attribute to a String e309. Incrementing a Double by the Smallest Possible Amount e310. Localizing Messages
© 2002 Addison-Wesley. |