Results 1 to 2 of 2
Thread: Getting ASCII codes of character
- 01-31-2008, 01:58 PM #1
Member
- Join Date
- Jan 2008
- Posts
- 17
- Rep Power
- 0
Getting ASCII codes of character
I am writing a method that will take a character and will check if it lies under ASCII range. I know the ASCII codes range but don't know exactly how to proceed. The method signature is as follows:
Kindly advice.Java Code:public static boolean validateCharacter(char a) { ... }
- 02-02-2008, 09:42 AM #2
If you know the range, you can simply check for the number in that range, for example:
You could also find an API provided ways to test for these problems.Java Code:1) if char [B]a[/B] is a value between 97 to 122 i) output "lowercase character" or "in range"
Vote for the new slogan to our beloved Java Forums! (closes on September 4, 2008)
Want to voice your opinion on your IDE/Editor of choice? Vote now!
Got a little Capt'n in you? (drink responsibly)
Similar Threads
-
How to obtain ASCII code of a character
By karma in forum New To JavaReplies: 4Last Post: 07-20-2008, 02:57 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks