Converts an array of bytes to an array of chars - CSharp System

CSharp examples for System:Byte Array

Description

Converts an array of bytes to an array of chars

Demo Code



public class Main{
        /// <summary>
      /// Converts an array of bytes to an array of chars
      /// </summary>
      /// <param name="byteArray">The array of bytes to convert</param>
      /// <returns>The new array of chars</returns>
      public static char[] ToCharArray(byte[] byteArray) 
      {/*from   w  ww .j av a2 s  .c o m*/
         return System.Text.UTF8Encoding.UTF8.GetChars(byteArray);
      }
}

Related Tutorials