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

     1  ---
     2  layout: docs
     3  page_title: join - Functions - Configuration Language
     4  description: |-
     5    The join function produces a string by concatenating the elements of a list
     6    with a given delimiter.
     7  ---
     8  
     9  # `join` Function
    10  
    11  `join` produces a string by concatenating together all elements of a given
    12  list of strings with the given delimiter.
    13  
    14  ```hcl
    15  join(separator, list)
    16  ```
    17  
    18  ## Examples
    19  
    20  ```shell-session
    21  > join(", ", ["foo", "bar", "baz"])
    22  foo, bar, baz
    23  > join(", ", ["foo"])
    24  foo
    25  ```
    26  
    27  ## Related Functions
    28  
    29  - [`split`](/docs/job-specification/hcl2/functions/string/split) performs the opposite operation: producing a list
    30    by separating a single string using a given delimiter.