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

# Replaceall

# \$replaceAll

The `$replaceAll` operator replaces all occurrences of a substring with a new substring in the original string.

## Input

* An array containing exactly three string values: the original string, the substring to replace, and the new substring

## Output

* The original string with all occurrences of the specified substring replaced

## Examples

### Basic Replace All

```json theme={null}
{
  "$replaceAll": [
    "Hello, world! Hello, universe!",
    "Hello",
    "Hi"
  ]
}
```

Result: `"Hi, world! Hi, universe!"`

### Field Value

```json theme={null}
{
  "$replaceAll": [
    {
      "$input": "text"
    },
    "old_word",
    "new_word"
  ]
}
```

Result: The text field with all occurrences of "old\_word" replaced with "new\_word"
