---
updatedAt: 2025-05-20T20:28:54.000Z
agentTools:
  projectIndex: https://docs.documotor.com/llms.txt
---

# join

Join strings from an array with a given separator

# Definition

`string join(string $separator, array[string] $stringsarray)`

Joins strings from `$stringsarray` with `$separator` in between them.

# Parameters

<Glossary>string</Glossary> `$separator`

Separator to use between elements of `$stringsarray`.

<Glossary>array</Glossary>[<<glossary:string>>] `$stringsarray`

Array of strings to be joined.

# Returns

<Glossary>string</Glossary>

Single string consisting of all elements from `$stringsarray` with `$separator` in between them.

# Examples

```text Transformation
{
  a: join(', ', ['dragon', 'fruit']),	
  b: join('', ['dragon', 'fruit']),
  c: join(', ', ['dragon', `false`, ' ', `null`, 'fruit']),	
  d: join(', ', [`1.0`]),
  e: join(', ', [`1.1`]),
  f: join(' - ', [`null`]),
  g: join(', ', `[]`),
  h: join(', ', `{dragon: 'fruit'}`)	
}
```

```json Result
{
  "a": "dragon, fruit",
  "b": "dragonfruit",
  "c": "dragon, False,  , , fruit",
  "d": "1",
  "e": "1.1",
  "f": "",
  "g": "",
  "h": ""
}
```