> ## Documentation Index
> Fetch the complete documentation index at: https://docs.apinizer.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Cleaning Quote (\"\") Marks from JSON Data with Replace Script

> Cleaning quote marks from JSON data

## Groovy Script

```groovy theme={null}
responseBodyTextToClient=responseBodyTextToClient.replace('\\\"','\"').replace('\"[','[').replace(']\"',']')
```

## Explanation

This script cleans unnecessary quote marks from JSON data in the response body:

1. **Fixing escaped quotes**: Replaces `\\"` characters with `"`
2. **Cleaning start quotes**: Replaces `"[` characters with `[`
3. **Cleaning end quotes**: Replaces `]"` characters with `]`

This operation is necessary for JSON data to be parsed correctly.

<Note>
  This script should be run on the response line (Response Policy) because it uses the `responseBodyTextToClient` variable.
</Note>
