Quick helper method to decode text - CSharp System

CSharp examples for System:String Encode Decode

Description

Quick helper method to decode text

Demo Code


using System;/*from w  w w . ja v a  2  s .c  o  m*/

public class Main{
        /// <summary>
        /// Quick helper method to decode text</summary>
        /// <param name="encodedString">Text that you want to be decoded</param>
        /// <returns>Decoded string that is plain text</returns>
        public static string Decode(String encodedString)
        {
            var base64EncodedBytes = System.Convert.FromBase64String(encodedString);
            return System.Text.Encoding.UTF8.GetString(base64EncodedBytes);
        }
}

Related Tutorials