Decompress String to String - CSharp System.IO.Compression

CSharp examples for System.IO.Compression:Zip

Description

Decompress String to String

Demo Code


using System.Text;
using System.IO.Compression;
using System.IO;/*from  w w w  .j  a v a 2s .  co m*/
using System;

public class Main{

        public static string DecompressString(string str)
        {
            string compressString = "";
            byte[] compressBeforeByte = Convert.FromBase64String(str);
            byte[] compressAfterByte = Decompress(compressBeforeByte);
            compressString = Encoding.GetEncoding("UTF-8").GetString(compressAfterByte);
            return compressString;
        }
}

Related Tutorials