Skip to main content

Arguments

string
required
Escaped JSON string content, or a complete quoted JSON string literal whose first and last bytes are quotes. The function reads this argument with string type checking.

Returns

string
Decoded string. Supported escapes include ”, \, /, \b, \f, \n, \r, \t, and \uXXXX with surrogate-pair handling. Invalid escapes, unescaped control characters, unterminated strings, and trailing characters after a quoted literal throw a Luau error with a near-position suffix.

Example

Decode JSON string escapes from escaped content or a quoted JSON string literal.