github.com/hugorut/terraform@v1.1.3/website/docs/language/functions/chomp.mdx (about) 1 --- 2 page_title: chomp - Functions - Configuration Language 3 description: The chomp function removes newline characters at the end of a string. 4 --- 5 6 # `chomp` Function 7 8 `chomp` removes newline characters at the end of a string. 9 10 This can be useful if, for example, the string was read from a file that has 11 a newline character at the end. 12 13 ## Examples 14 15 ``` 16 > chomp("hello\n") 17 hello 18 > chomp("hello\r\n") 19 hello 20 > chomp("hello\n\n") 21 hello 22 ``` 23 24 ## Related Functions 25 26 * [`trimspace`](/language/functions/trimspace), which removes all types of whitespace from 27 both the start and the end of a string.