github.com/rstandt/terraform@v0.12.32-0.20230710220336-b1063613405c/website/docs/configuration/functions/trimsuffix.html.md (about) 1 --- 2 layout: "functions" 3 page_title: "trimsuffix - Functions - Configuration Language" 4 sidebar_current: "docs-funcs-string-trimsuffix" 5 description: |- 6 The trimsuffix function removes the specified suffix from the end of a 7 given string. 8 --- 9 10 # `trimsuffix` Function 11 12 -> **Note:** This page is about Terraform 0.12 and later. For Terraform 0.11 and 13 earlier, see 14 [0.11 Configuration Language: Interpolation Syntax](../../configuration-0-11/interpolation.html). 15 16 `trimsuffix` removes the specified suffix from the end of the given string. 17 18 ## Examples 19 20 ``` 21 > trimsuffix("helloworld", "world") 22 hello 23 ``` 24 25 ## Related Functions 26 27 * [`trim`](./trim.html) removes characters at the start and end of a string. 28 * [`trimprefix`](./trimprefix.html) removes a word from the start of a string. 29 * [`trimspace`](./trimspace.html) removes all types of whitespace from 30 both the start and the end of a string.