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

> Escapet einen string mit Real JSON string escaping rules und gibt den escaped content ohne surrounding quotes zurueck.

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

  ## Argumente

  <ParamField path={"text"} type={"string"} required>
    String, der escaped wird. Die function liest dieses argument mit string type checking.
  </ParamField>

  ## Rückgaben

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

  ## Beispiel

  Escape einen string fuer das Innere eines JSON string, ohne surrounding quotes hinzuzufuegen.

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

  print(escaped)
  ```
</div>
