468,765 Members | 804 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,765 developers. It's quick & easy.

Getting an ascii value from a byte

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!
Nov 16 '05 #1
1 2357
Hi,
Just cast the number (or the byte value) to char type as in
Console.WriteLine ((char)82);

"James Dean" <m_*******@yahoo.com> wrote in message
news:uZ*************@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!
Nov 16 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

12 posts views Thread by Peter Wilkinson | last post: by
3 posts views Thread by Director - Minvent | last post: by
14 posts views Thread by Ankit Aneja | last post: by
6 posts views Thread by SandyMan | last post: by
7 posts views Thread by Jeffrey Spoon | last post: by
9 posts views Thread by CapCity | last post: by
9 posts views Thread by =?Utf-8?B?RGFu?= | last post: by
1 post views Thread by CARIGAR | last post: by
reply views Thread by zhoujie | last post: by
reply views Thread by Marin | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.