github.com/Ilhicas/nomad@v1.0.4-0.20210304152020-e86851182bc3/website/content/docs/job-specification/hcl2/functions/string/trimsuffix.mdx (about)

     1  ---
     2  layout: docs
     3  page_title: trimsuffix - Functions - Configuration Language
     4  sidebar_title: trimsuffix
     5  description: |-
     6    The trimsuffix function removes the specified suffix from the end of a
     7    given string.
     8  ---
     9  
    10  # `trimsuffix` Function
    11  
    12  `trimsuffix` removes the specified suffix from the end of the given string.
    13  
    14  ## Examples
    15  
    16  ```shell-session
    17  > trimsuffix("helloworld", "world")
    18  hello
    19  ```
    20  
    21  ## Related Functions
    22  
    23  - [`trim`](/docs/job-specification/hcl2/functions/string/trim) removes characters at the start and end of a string.
    24  - [`trimprefix`](/docs/job-specification/hcl2/functions/string/trimprefix) removes a word from the start 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.