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.
trimprefix removes the specified prefix from the start of the given string. If the string does not start with the prefix, the string is returned unchanged.
> trimprefix("helloworld", "hello") world > trimprefix("helloworld", "cat") helloworld