github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/job-specification/hcl2/functions/string/trimspace.mdx (about) 1 --- 2 layout: docs 3 page_title: trimspace - Functions - Configuration Language 4 description: |- 5 The trimspace function removes space characters from the start and end of 6 a given string. 7 --- 8 9 # `trimspace` Function 10 11 `trimspace` removes any space characters from the start and end of the given 12 string. 13 14 This function follows the Unicode definition of "space", which includes 15 regular spaces, tabs, newline characters, and various other space-like 16 characters. 17 18 ## Examples 19 20 ```shell-session 21 > trimspace(" hello\n\n") 22 hello 23 ``` 24 25 ## Related Functions 26 27 - [`chomp`](/docs/job-specification/hcl2/functions/string/chomp) removes just line ending characters from the _end_ of 28 a string.