github.com/anth0d/nomad@v0.0.0-20221214183521-ae3a0a2cad06/website/content/docs/job-specification/hcl2/functions/string/trimprefix.mdx (about)

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