> ## 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
  ```

  ## الوسائط

  <ParamField path={"text"} type={"string"} required>
    String الذي سيتم escape له. Function تقرأ هذا argument باستخدام string type checking.
  </ParamField>

  ## القيم الراجعة

  <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>
