MathTop

decode_string 函数

使用指定文本编码方式还原字符串。

语法

  • StringTools:-Decode(text)
  • StringTools:-Decode(text, encoding = base64)
  • Decode(text, encoding)

参数与选项

text文本值,通常写在引号中。
encoding可选编码名:null、base64、percent、rot13、rot[n] 或 alpharot[n]。

示例

  1. Base64 解码StringTools:-Decode('aGVsbG8=', encoding = base64)返回 hello。
  2. 百分号解码Decode('a%20b', percent)返回 a b。
  3. ROT13 解码StringTools:-Decode('Nycun', rot13)返回 Alpha。