Skip to main content

参数

string
必填
Escaped JSON string content,或 first and last bytes 为 quotes 的 complete quoted JSON string literal。function 使用 string type checking 读取此 argument。

返回值

string
Decoded string。Supported escapes 包括 ”、\、/、\b、\f、\n、\r、\t,以及带 surrogate-pair handling 的 \uXXXX。Invalid escapes、unescaped control characters、unterminated strings,以及 quoted literal 后的 trailing characters 会抛出带 near-position suffix 的 Luau error。

示例

从 escaped content 或 quoted JSON string literal 解码 JSON string escapes。