json. unescape Synchronous
Decode JSON escape sequences from string contents. It accepts either a quoted JSON string token or its contents without the outer quotes.
Luau
json.unescape(text: string) -> stringParameters
| Parameter | Type | Description |
|---|---|---|
text | string | Escaped JSON string text, optionally enclosed in double quotation marks. |
Returns
stringThe unescaped Luau string. Invalid JSON escapes raise an error.
Usage notes
Use json.decode for an entire JSON document, including arrays and objects.
Example
Luau
local text = json.unescape([[line\nnext]])
print(text)