Wrox Home  
Search P2P Archive for: Go

  Return to Index  

pro_java_server thread: get ascii value of character


Message #1 by mark@m... on Mon, 19 Mar 2001 10:48:41 -0600
thanks,

We also found out that if you do:
String.getBytes();

the resulting byte array has the correct values.

But Character.getNumericValue() [which I already knew about] 
returns the JVM's integer representation of the number and not the 
ordinal value of the character. This is a bug, but Sun has chosen to 
attempt to fix by clarifying through the Javadocs (go look in the bug 
database :).

Thanks to everyone for answering my question.
Mark


On 20 Mar 01, at 13:47, Rajan_Behal wrote:

> I think U can cast into an int that will give u the ascii value
> 
> eg.
>  char c = 'a';
>  b = (int) c;
> b will have ascii value of 'a'
> 
> With Regards
> 
> Rajan Behal
> 
> > -----Original Message-----
> > From:	mark@m... [SMTP:mark@m...]
> > Sent:	Monday, March 19, 2001 10:19 PM
> > To:	Java Server
> > Subject:	get ascii value of character
> > 
> > Hi,
> > How do you get the ascii value of a character?
> > 
> > ie if I have a char c= "a", I do I find out it's ascii/unicode
> > value?
> > 
> > thanks,
> > 
> > Mark
> > Mark Wilcox
> > mark@m...
> > Got LDAP?


Mark Wilcox
mark@m...
Got LDAP?

  Return to Index