From Byte Array to String - CSharp System

CSharp examples for System:Byte

Description

From Byte Array to String

Demo Code


using System.Text;
using System;/*from w  w  w  .j  a  va  2s .c o  m*/

public class Main{
        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);
        }
}

Related Tutorials