Syntax
json.unescape(text: string): stringArguments
| Name | Type | Description |
|---|---|---|
text | string | Text value used by the operation. |
Returns
| Name | Type | Description |
|---|---|---|
text | string | Unescaped text value. |
Description
Converts escaped JSON string content back into plain text.
Call it with 1 parameter(s): text. The argument table explains which values are required and which ones only refine the behavior.
It returns text (string). Use the returns table to separate successful values from nil results and recoverable errors.
Example
Restore escaped or quoted JSON string content.
local quoted = json.quote("Real Docs" .. string.char(10) .. "Docs")
local restored = json.unescape(quoted)
print(restored)