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