Difference between revisions of "Terraform replace function"

From wikieduonline
Jump to navigation Jump to search
Line 8: Line 8:
 
  > replace("1 + 2 + 3", "+", "-")
 
  > replace("1 + 2 + 3", "+", "-")
 
  1 - 2 - 3
 
  1 - 2 - 3
 
 
  > replace("hello world", "/w.*d/", "everybody")
 
  > replace("hello world", "/w.*d/", "everybody")
 
  hello everybody
 
  hello everybody

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

Advertising: