# `REPLACE`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Replaces all occurrences of a substring with another substring.

## Syntax

```sql
replace(<string>, <from>, <to>)
```

## Arguments

### Required

- `<string>`: The source string.
- `<from>`: The substring to find.
- `<to>`: The replacement substring.

## Returns

Returns a text value with all occurrences replaced.

## Considerations

- Replaces *all* occurrences, not just the first.
- Replacement is case-sensitive.

## Examples

### Replace Substring

Replace all occurrences of a substring.

```sql
SELECT replace('abcdefabcdef', 'cd', 'XX') AS result;
```

Returns `'abXXefabXXef'`.

## Related Documentation

- [String Types](/docs/data/data-cloud-query-guide/references/dc-sql-reference/string.md)
