Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » Apache Tomcat »

Converting characters to "ascii" value

David Kerber

2006-03-19

Replies:

I know "Ascii value" isn't quite the correct term, but it's the only one
I could come up with.

What Im trying to come up with is the simplest way of coming up with the
numeric value associated with a given character, and to go back the
other direction as well. In VB, these are the ASC() and chr()
functions. I know how to get these values by going through a Byte type,
but is there a quicker way to get (for example):

Starting with "B", return 66, or starting with " " (one space), return 32?
Going the other way, 66 should return "B", and 32 should return " ".

Thanks for any suggestions!
DAve



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@(protected)
For additional commands, e-mail: users-help@(protected)

©2008 junlu.com - Jax Systems, LLC, U.S.A.