Link to home
Start Free TrialLog in
Avatar of RobertFromSecretWeapons
RobertFromSecretWeapons

asked on

Converting Byte Value to ASCII printable character

Hi All,
I need a method that converts a Byte to a printable character.
I know this seems stupid, I just can't find a method that does this.

I have an array of bytes:

Dim ByteArray() as Byte = { &H48, &H54, &H54, &H50 }

String.Format("{0}", ByteArray(0).ToString)

When I use the ByteArray(0).ToString function, I get the decimal value printed instead of the actual character like "H".


ASKER CERTIFIED SOLUTION
Avatar of Shahan Ayyub
Shahan Ayyub
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
*I like kaufmed's answer better though.
Avatar of RobertFromSecretWeapons
RobertFromSecretWeapons

ASKER

Thx so much.  All very good and usable suggestions.