json. unescape Synchronous
Decode JSON string escapes from quoted or unquoted text. Use it to restore text received as escaped JSON string contents. For a complete JSON document, use json.decode instead.
Luau
json.unescape(text: string) -> stringParameters
| Parameter | Type | Description |
|---|---|---|
text | string | JSON-escaped string contents, optionally enclosed in quotation marks. |
Returns
stringThe unescaped text.
Example
Luau
local restored = json.unescape([[first\nsecond]])
print(restored) -- two lines
print(json.unescape([["quoted text"]])) -- quoted text