---
title: "join"
url: https://una-lang.org/en/docs/std/prelude/join/
release: v0.4.0
edition: "0.2 and later"
source: https://github.com/una-lang/una/blob/v0.4.0/docs/std/listing.json
---

# join

A function of the prelude, in scope in every module. Edition 0.2 and later.

```una
pub join(parts: List[Text], separator: Text) -> Text
```

The parts joined, with `separator` between each two (`spec/22 §2`).

## Parameters

- `parts`: the texts to join\, in order
- `separator`: the text between each two parts

## Returns

`Text`: the parts joined\, with `separator` between each two.

## See also

[`split`](https://una-lang.org/en/docs/std/prelude/split/)

## Cost

Time `O(total bytes)` (ADR 0070), where:

- total bytes: the length of the result in UTF\-8 bytes\: the parts and the separators between them

## Example

`src/shop.una`

```una
module shop

--- The items of an order as one line.
pub main() -> Unit
  uses @console: Console[print]
=
  @console.print(join(["Café", "Crème", "Thé"], separator: ", "))
```

`una run .` prints:

```text
Café, Crème, Thé
```

## Specification

- [`spec/22 §2`](https://una-lang.org/en/docs/spec/22-text/#s2)

Generated from the standard modules of una v0.4.0 ([`docs/std/listing.json`](https://github.com/una-lang/una/blob/5fec93d88932b333feec25e589355a2cb34c37b5/docs/std/listing.json), which is not part of the specification). The specification governs: [`spec/14 §1`](https://una-lang.org/en/docs/spec/14-standard-library/#s1).
