Connecting Tech Pros Worldwide Forums | Help | Site Map

Getting an ascii value from a byte

James Dean
Guest
 
Posts: n/a
#1: Nov 16 '05
i want to be able to get the correct ascii value from a byte without
having to use the Convert.ToChar function as a char takes up two bytes
of space and it is affecting the performance of my program. I know that
for example the char value 'R' is '82' in byte form. What i want is to
be able to translate byte numbers to their ascii equivalent quickly and
easily(e.g."54 is 6 in ascii code") with as little processing as
possible......


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Shiva
Guest
 
Posts: n/a
#2: Nov 16 '05

re: Getting an ascii value from a byte


Hi,
Just cast the number (or the byte value) to char type as in
Console.WriteLine ((char)82);

"James Dean" <m_dorrian@yahoo.com> wrote in message
news:uZgN6pFeEHA.724@TK2MSFTNGP10.phx.gbl...
i want to be able to get the correct ascii value from a byte without
having to use the Convert.ToChar function as a char takes up two bytes
of space and it is affecting the performance of my program. I know that
for example the char value 'R' is '82' in byte form. What i want is to
be able to translate byte numbers to their ascii equivalent quickly and
easily(e.g."54 is 6 in ascii code") with as little processing as
possible......


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!


Closed Thread