> For the complete documentation index, see [llms.txt](https://sevenval.gitbook.io/flat/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sevenval.gitbook.io/flat/reference/functions/join.md).

# join()

```
string join(glue, input1, input2 …)
```

`join()` returns a string that contains all given input arguments with the `glue` string between them.

The function is variadic. It accepts an arbitrary number of arguments. The second and following arguments are used as input.

Example with basic types:

```
join(":", "a", "b")
```

returns `a:b`.

Each input argument can be a string or a number or a node-set. In the latter case, all nodes in the node-set are cast to a string.

Example XML input:

```markup
<names>
  <n>Alice</n>
  <n>Bob</n>
</names>
```

Call with node-set:

```
join(", ", names/*)
```

returns `Alice, Bob`.

Example JSON input:

```javascript
{
  "names": [
    "Alice",
    "Bob"
  ]
}
```

If an argument is a JSON array, its values will be joined:

```
join(", ", names)
```

returns `Alice, Bob`.
