You're looking at documentation for Terraform v1.1 and earlier. Click here to view the latest content.
A new platform for documentation and tutorials is launching soon.
We are migrating Terraform documentation into HashiCorp Developer, our new developer experience.
trim removes the specified set of characters from the start and end of the given
Every occurrence of a character in the second argument is removed from the start and end of the string specified in the first argument.
> trim("?!hello?!", "!?") "hello" > trim("foobar", "far") "oob" > trim(" hello! world.! ", "! ") "hello! world."