aardio 文档
aardio 范例: escape2 编码
//escape2 编码
import string.escape2;
//以除 '\0' 以外的所有单字节为 key,并自动获取长度最短的 escape2 编码字符串。
var e2 = string.escape2('测试字符串','\0');
//按 F5 运行查看结果
print(`<textarea style="width:100%" onfocus="this.select()">'`,
e2,"'</textarea>");
//将普通的字符串作为唯一参数就会直接返回。
//将 escape2 编码的字符串作为唯一参数会复原后再返回。
//escape2 格式字符串必须先取消转义,或者使用单引号包含转义字符串。
var s2 = string.escape2('\0\48\67\91\29\5\83\2\3\4\5\0\83\8\4\85\5\4\0\83\83\9\5\9\4\1\85\3\86\6\82\5\4\83\86\2\0');
//以参数 @2 指定的单个单字节字符为 key,escape2 编码参数 @1。
var e2 = string.escape2('测试字符串','\123');
Markdown 格式