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

> Escapa un string usando Real JSON string escaping rules y devuelve el escaped content sin surrounding quotes.

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

  ## Argumentos

  <ParamField path={"text"} type={"string"} required>
    String que se va a escape. La function lee este argument con string type checking.
  </ParamField>

  ## Retornos

  <ResponseField name={"escaped"} type={"string"}>
    Escaped JSON string content sin opening ni closing quote. Quotes, backslashes, common control characters y bytes below 0x20 se escapan.
  </ResponseField>

  ## Ejemplo

  Escape un string para el interior de un JSON string sin agregar surrounding quotes.

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

  print(escaped)
  ```
</div>
