Encoding.Base64Decode
Skip to content
mnscript
StringResult Encoding.Base64Decode(string) 

Description ​

Decodes a Base64 string back to characters.

Arguments ​

string - The Base64 string to convert.

Returns ​

StringResult - The characters.

Example ​

msc
using Encoding;
using System;

// Converts "SGVsbG8gV29ybGQh" back to characters.
// "SGVsbG8gV29ybGQh" is Base64 for "Hello World!"

StringResult base64 = Encoding.Base64ToChars("SGVsbG8gV29ybGQh");

if(base64.GetResult()){
    // If the conversion was successful, the result will be in GetString.
    Console.WriteLine("Characters: "..base64.GetString());
}else{
    // If the conversion failed, the error reason will be in GetString.
    Console.WriteLine("Error: "..base64.GetString());
}