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.

Syntax
Luau
json.unescape(text: string) -> string

Parameters

Function parameters
ParameterTypeDescription
textstringJSON-escaped string contents, optionally enclosed in quotation marks.

Returns

string

The unescaped text.

Example

Example
Luau
local restored = json.unescape([[first\nsecond]])
print(restored) -- two lines
print(json.unescape([["quoted text"]])) -- quoted text
Kawaii documentation