open-nomad/website/pages/docs/job-specification/hcl2/functions/string/join.mdx
Mahmood Ali d1e139c3fb
Docs for HCL2 (#9322)
Add more detailed HCL2 docs, mostly lifted from Packer with tweaks for Nomad.

The function docs are basically verbatim taken from Packer with basic string substitutions. I commented out some for_each details as the examples are mostly driven towards Packer resources. I'll iterate on those with better Nomad examples.
2020-11-29 20:36:41 -05:00

32 lines
692 B
Plaintext

---
layout: docs
page_title: join - Functions - Configuration Language
sidebar_title: join
description: |-
The join function produces a string by concatenating the elements of a list
with a given delimiter.
---
# `join` Function
`join` produces a string by concatenating together all elements of a given
list of strings with the given delimiter.
```hcl
join(separator, list)
```
## Examples
```shell-session
> join(", ", ["foo", "bar", "baz"])
foo, bar, baz
> join(", ", ["foo"])
foo
```
## Related Functions
- [`split`](/docs/job-specification/hcl2/functions/string/split) performs the opposite operation: producing a list
by separating a single string using a given delimiter.