Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

How to: Convert an Array of Bytes into a String in Visual Basic

This topic shows how to convert the bytes from a byte array into a string.

This example uses the GetString method of the Encoding.Unicode encoding class to convert all the bytes from a byte array into a string.

Private Function UnicodeBytesToString( 
    ByVal bytes() As Byte) As String 

    Return System.Text.Encoding.Unicode.GetString(bytes)
End Function

You can choose from several encoding options to convert a byte array into a string:

Show:
© 2015 Microsoft