> ## Documentation Index
> Fetch the complete documentation index at: https://docs.projectreal.gg/llms.txt
> Use this file to discover all available pages before exploring further.

# json.escape

> Escape mot string bang Real JSON string escaping rules va tra ve escaped content khong co surrounding quotes.

<div className="real-function-page">
  ```lua theme={null}
  json.escape(text: string): string
  ```

  ## Đối số

  <ParamField path={"text"} type={"string"} required>
    String se duoc escape. Function doc argument nay bang string type checking.
  </ParamField>

  ## Giá trị trả về

  <ResponseField name={"escaped"} type={"string"}>
    Escaped JSON string content khong co opening va closing quote. Quotes, backslashes, common control characters va bytes below 0x20 duoc escape.
  </ResponseField>

  ## Ví dụ

  Escape string cho phan ben trong JSON string ma khong them surrounding quotes.

  ```lua theme={null}
  local source = "line 1" .. string.char(10) .. [[line "2"]]
  local escaped = json.escape(source)

  print(escaped)
  ```
</div>
