Zachary Shilton 830140157d
website: remove obselete nav data (#10811)
* website: remove obselete sidebar_title frontmatter from docs

* website: bump to latest docs-page

* website: update plugin creation and registration docs

* website: fix broken links
2021-03-31 15:07:00 -04:00

31 lines
785 B
Plaintext

---
page_title: replace - Functions - Configuration Language
description: |-
The replace function searches a given string for another given substring,
and replaces all occurrences with a given replacement string.
---
# `replace` Function
`replace` searches a given string for another given substring, and replaces
each occurrence with a given replacement string.
```hcl
replace(string, substring, replacement)
```
## Examples
```shell-session
> replace("1 + 2 + 3", "+", "-")
1 - 2 - 3
> replace("hello world", "world", "everybody")
hello everybody
```
## Related Functions
- [`regex_replace`](/docs/templates/hcl_templates/functions/string/regex_replace) searches a given string for another given substring,
and replaces each occurrence with a given replacement string.