Difference between revisions of "Terraform replace function"
Jump to navigation
Jump to search
| Line 4: | Line 4: | ||
replace(string, substring, replacement) | replace(string, substring, replacement) | ||
| + | === Example === | ||
| + | |||
| + | > replace("1 + 2 + 3", "+", "-") | ||
| + | 1 - 2 - 3 | ||
| + | |||
| + | > replace("hello world", "/w.*d/", "everybody") | ||
| + | hello everybody | ||
== See also == | == See also == | ||
Revision as of 21:48, 27 February 2022
https://www.terraform.io/language/functions/replace
replace(string, substring, replacement)
Example
> replace("1 + 2 + 3", "+", "-")
1 - 2 - 3
> replace("hello world", "/w.*d/", "everybody")
hello everybody
See also
- Terraform functions, Terraform collection functions:
tolist,toset,length,sum,file,join,depends_on,zipmap,replace,lookup,read files,concat,merge, templatefile, for_each, format, element, slice, try, filebase64, upper, filemd5, coalesce, formatlist, flatten, sensitive, tonumber, jsondecode, yamldecode, pathexpand
Advertising: