write a method in java that takes character data type as input in return what exactly the character contains like letter or digit or whitespace
Answers
Answered by
2
Answer:
If you want to know if a character is a Unicode letter or digit, then use the Character.isLetter and Character.isDigit methods.
If you want to know if a character is an ASCII letter or digit, then the best thing to do is to test by comparing with the character ranges 'a' to 'z', 'A' to 'Z' and '0' to '9'.
Similar questions