Byte to string

Stormweaver1

Member
Joined
Jun 12, 2006
Messages
13
Programming Experience
Beginner
I am wondering how I can turn a byte into a string.

I want to create a for loop to cycle throgh ASCii. Any help is apreciated.

Anybody got any tips?
 

vis781

Well-known member
Joined
Aug 30, 2005
Messages
2,015
Location
Cambridge, UK
Programming Experience
5-10
Try this...

VB.NET:
Dim dBytes As Byte() = ...
Dim str As String
Dim Encodng As New System.Text.ASCIIEncoding()
str = Encodng.GetString(dBytes)
 

JohnH

VB.NET Forum Moderator
Staff member
Joined
Dec 17, 2005
Messages
15,553
Location
Norway
Programming Experience
10+
If you're only converting a single byte there is also the System.Convert class.
VB.NET:
Dim b As Byte = 65
Dim c As Char = Convert.ToChar(b)
MsgBox(c.ToString)
 
Top Bottom