github.com/muratcelep/terraform@v1.1.0-beta2-not-internal-4/website/docs/language/functions/chomp.html.md (about)

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