> ## 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'uje string uzywajac Real JSON string escaping rules i zwraca escaped content bez surrounding quotes.

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

  ## Argumenty

  <ParamField path={"text"} type={"string"} required>
    String do escape. Function czyta ten argument przez string type checking.
  </ParamField>

  ## Zwroty

  <ResponseField name={"escaped"} type={"string"}>
    Escaped JSON string content bez opening i closing quote. Quotes, backslashes, common control characters oraz bytes below 0x20 sa escaped.
  </ResponseField>

  ## Przykład

  Escape string do wnetrza JSON string bez dodawania surrounding quotes.

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

  print(escaped)
  ```
</div>
