The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
August 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Use characters to store ascii values

Posted by Hiran on August 02, 2001 at 10:33 AM

Hey, if you use a character type, you can assign the character to an ascii value (ex. char c = 65;, or char c = (char)65;).
So if you wanted to parse a String to check for alphanumeric characters, what you can do is create a character array that stores the ascii values of all the alphanumeric characters you want to check for, and use a for loop to parse your string and check against the character array.
Hope this helps! If you want a list of all the ascii values and their character equivalents, you can email me at, and I'll gladly send it to you.


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us