To UTF8 Memory Stream - CSharp System

CSharp examples for System:String Unicode

Description

To UTF8 Memory Stream

Demo Code


using System.Text;
using System.IO;//w ww .j  ava  2s  .  c o m

public class Main{
        public static Stream ToUTF8MemoryStream(this string source)
        {
            return new MemoryStream(Encoding.UTF8.GetBytes(source ?? ""));
        }
}

Related Tutorials