Convert ascii code to string

  • Thread starter Thread starter Daniel Passwater via DotNetMonster.com
  • Start date Start date
D

Daniel Passwater via DotNetMonster.com

I am working on an app that is receiving hex numerical values via serial connection. I am now to the point that I have converted each byte into its ascii code value. Could comeone please tell me how to convert 48 to 0, 49 to 1, etc? I need to display this in a textbox.
Thanks in advance for any and all help.
 
Daniel Passwater via DotNetMonster.com said:
I am working on an app that is receiving hex numerical values via
serial connection. I am now to the point that I have converted each
byte into its ascii code value. Could comeone please tell me how to
convert 48 to 0, 49 to 1, etc? I need to display this in a textbox.

If you've got an array of such bytes, the easiest way is to use
Encoding.ASCII.GetString (theByteArray);

To convert a single byte into a string, use ((char)theByte).ToString();
 
Back
Top