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