github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/job-specification/hcl2/functions/string/trim.mdx (about) 1 --- 2 layout: docs 3 page_title: trim - Functions - Configuration Language 4 description: |- 5 The trim function removes the specified characters from the start and end of 6 a given string. 7 --- 8 9 # `trim` Function 10 11 `trim` removes the specified characters from the start and end of the given 12 string. 13 14 ## Examples 15 16 ```shell-session 17 > trim("?!hello?!", "!?") 18 hello 19 ``` 20 21 ## Related Functions 22 23 - [`trimprefix`](/docs/job-specification/hcl2/functions/string/trimprefix) removes a word from the start of a string. 24 - [`trimsuffix`](/docs/job-specification/hcl2/functions/string/trimsuffix) removes a word from the end of a string. 25 - [`trimspace`](/docs/job-specification/hcl2/functions/string/trimspace) removes all types of whitespace from 26 both the start and the end of a string.