How do I convert byte array into string?
Category: System.Text, viewed: 409 time(s).
In the following example you'll see how we convert a array of bytes of ASCII characters and UTF-16 characters into string. To get the string of this bytes we use the ASCIIEncoding and UnicodeEncoding classes which can be located in the System.Text namespace.
The ASCIIEncoding.GetString method converts 7-bit ASCII characters from the byte array into a string. Any value larger than 127 is converted to the ? character. And the UnicodeEncoding.GetString method converts 16-bit unicode characters from the byte array into a string.
Download Hundreds of Complimentary Industry Resources
Get hundreds of popular Industry magazines, white papers, webinars, podcasts, and more;
all available at no cost to you. With more than 600 complimentary offers, you'll find
plenty of titles to suit your professional interests and needs.
Click Here and Sign up today!
Related Examples
|
|