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

# String: Replace

> Replaces within a string based on a string comparison.

export const FormField = ({property, label, required = false, diType, uiPatterns, children}) => {
  const patterns = Array.isArray(uiPatterns) ? uiPatterns : uiPatterns ? [uiPatterns] : [];
  return <div style={{
    margin: '1.5rem 0'
  }}>
      <div style={{
    display: 'flex',
    alignItems: 'baseline',
    flexWrap: 'wrap',
    gap: '0.5rem',
    marginBottom: '0.25rem'
  }}>
        <strong>{label}</strong>
        <span style={{
    fontSize: '0.7rem',
    fontWeight: 600,
    textTransform: 'uppercase',
    letterSpacing: '0.04em',
    color: required ? '#6241f5' : '#6b7280'
  }}>
          {required ? 'Required' : 'Optional'}
        </span>
      </div>

      <div>{children}</div>

      {diType || patterns.length > 0 ? <p style={{
    fontSize: '0.85rem',
    color: '#6b7280',
    marginBottom: 0
  }}>
          {diType ? <>
              See the <a href={`/references/${diType}`}>{diType}</a> reference.{' '}
            </> : null}
          {patterns.length > 0 ? <>
              Accepts a <a href={`/documentation/placeholders-and-patterns/patterns#${patterns[0]}`}>pattern</a>.
            </> : null}
        </p> : null}
    </div>;
};

Finds every occurrence of a piece of text inside a value and swaps it for something else. Use this for straightforward find-and-replace work, such as renaming a term across your data, fixing a recurring typo, or removing an unwanted phrase by replacing it with nothing. The match is literal: it looks for the exact text you enter, and every match in the value is replaced. If you need flexible matching rather than an exact match, use the [Replace using regular expression](/references/mapper/string-regex-replace) mapper instead.

This documentation describes: [Schema](/schemas/mapper/string-replace)

## Fields

<FormField property="search" label="Search" required>
  The exact text to look for. Every occurrence found in the value is replaced.
</FormField>

<FormField property="replace" label="Replace">
  The text to put in place of each match. Leave it empty to simply remove the matched text.
</FormField>

## Sample data

| Field   | Value     |
| ------- | --------- |
| Search  | `T-Shirt` |
| Replace | `Tee`     |

Input:

```json theme={null}
{ "name": "Cotton T-Shirt (Red)" }
```

Output:

```json theme={null}
{ "name": "Cotton Tee (Red)" }
```

```json Configuration theme={null}
{
  "prototype": "string-replace",
  "parameters": {
    "search": "T-Shirt",
    "replace": "Tee"
  }
}
```
