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

> Meng-escape string memakai Real JSON string escaping rules dan mengembalikan escaped content tanpa surrounding quotes.

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

  ## Argumen

  <ParamField path={"text"} type={"string"} required>
    String yang akan di-escape. Function membaca argument ini dengan string type checking.
  </ParamField>

  ## Return

  <ResponseField name={"escaped"} type={"string"}>
    Escaped JSON string content tanpa opening dan closing quote. Quotes, backslashes, common control characters, dan bytes below 0x20 di-escape.
  </ResponseField>

  ## Contoh

  Escape string untuk bagian dalam JSON string tanpa menambahkan surrounding quotes.

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

  print(escaped)
  ```
</div>
