To convert a Byte Array of Unicode values (UTF-8 encoded) to a complete String. - CSharp System

CSharp examples for System:String Unicode

Description

To convert a Byte Array of Unicode values (UTF-8 encoded) to a complete String.

Demo Code


using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from w  w  w  .  j ava2s. c om

public class Main{
        /// <summary>
        /// To convert a Byte Array of Unicode values (UTF-8 encoded) to a complete String.
        /// </summary>
        /// <param name="characters">Unicode Byte Array to be converted to String</param>
        /// <returns>String converted from Unicode Byte Array</returns>
        static public String UTF8ByteArrayToString(Byte[] characters)
        {
            UTF8Encoding encoding = new UTF8Encoding();
            String constructedString = encoding.GetString(characters);
            return (constructedString);
        }
}

Related Tutorials