语法
json.unescape(text: string): string参数
| 名称 | 类型 | 描述 |
|---|---|---|
text | string | 操作使用的文本值。 |
返回值
| 名称 | 类型 | 描述 |
|---|---|---|
text | string | 未转义的文本值。 |
说明
将转义的 JSON 字符串内容转换回纯文本。
使用 1 个参数调用: text。参数表会说明哪些值必填,哪些值只用于细化行为。
返回 text (string)。使用返回表区分成功值、nil 结果和可恢复错误。
示例
恢复转义或引用的 JSON 字符串内容。
local quoted = json.quote("Real Docs" .. string.char(10) .. "Docs")
local restored = json.unescape(quoted)
print(restored)