Files
Packer-Cn/website/pages/docs/from-1.5/functions/string/join.mdx
T

32 lines
678 B
Plaintext
Raw Normal View History

---
2020-03-18 18:46:47 -04:00
layout: docs
page_title: join - Functions - Configuration Language
2020-04-02 19:39:47 -04:00
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
2020-04-01 15:15:54 -04:00
- [`split`](/docs/from-1.5/functions/string/split) performs the opposite operation: producing a list
by separating a single string using a given delimiter.