Convert byte array to string

image_pdfimage_print

using System;

public sealed class Strings
{

public static string FromByteArray(byte[] bs)
{
char[] cs = new char[bs.Length];
for (int i = 0; i < cs.Length; ++i) { cs[i] = Convert.ToChar(bs[i]); } return new string(cs); } } [/csharp]

This entry was posted in Data Types. Bookmark the permalink.