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

> Real JSON string escaping rules를 사용해 string을 escape하고 surrounding quotes 없는 escaped content를 반환합니다.

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

  ## 인수

  <ParamField path={"text"} type={"string"} required>
    Escape할 string입니다. function은 이 argument를 string type checking으로 읽습니다.
  </ParamField>

  ## 반환값

  <ResponseField name={"escaped"} type={"string"}>
    Opening 및 closing quote 없는 escaped JSON string content입니다. Quotes, backslashes, common control characters, bytes below 0x20은 escape됩니다.
  </ResponseField>

  ## 예제

  Surrounding quotes를 추가하지 않고 JSON string 내부용으로 string을 escape합니다.

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

  print(escaped)
  ```
</div>
