String To Byte Array UTF8 - CSharp System

CSharp examples for System:Byte Array

Description

String To Byte Array UTF8

Demo Code


using System.Text;
using System.Collections.Generic;
using System;//  w  ww.ja  v  a2  s. c o m

public class Main{
        public static byte[] ToByteArrayUTF8(string str)
        {
            return new UTF8Encoding().GetBytes(str);
        }
}

Related Tutorials