String From Byte Array - CSharp System

CSharp examples for System:Byte

Description

String From Byte Array

Demo Code


using System.Text;
using System;/*  w  w w .java2s. com*/

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