> ## 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 string ด้วย Real JSON string escaping rules และคืน escaped content โดยไม่มี surrounding quotes.

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

  ## Arguments

  <ParamField path={"text"} type={"string"} required>
    String ที่จะ escape. function อ่าน argument นี้ด้วย string type checking.
  </ParamField>

  ## Returns

  <ResponseField name={"escaped"} type={"string"}>
    Escaped JSON string content โดยไม่มี opening และ closing quote. Quotes, backslashes, common control characters และ bytes below 0x20 จะถูก escape.
  </ResponseField>

  ## ตัวอย่าง

  Escape string สำหรับด้านในของ JSON string โดยไม่เพิ่ม surrounding quotes.

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

  print(escaped)
  ```
</div>


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.