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

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