---
title: "joined(separator:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/unsafebufferpointer/joined(separator:)-7ubg0"
---

# joined(separator:)

Returns the concatenated elements of this sequence of sequences, inserting the given separator between each element.

## Declaration

```swift
func joined<Separator>(separator: Separator) -> JoinedSequence<Self> where Separator : Sequence, Separator.Element == Self.Element.Element
```

## Parameters

- `separator`: A sequence to insert between each of this sequence’s elements.

## Return Value

Return Value The joined sequence of elements.

## Discussion

Discussion This example shows how an array of [Int] instances can be joined, using another [Int] instance as the separator: let nestedNumbers = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] let joined = nestedNumbers.joined(separator: [-1, -2]) print(Array(joined)) // Prints "[1, 2, 3, -1, -2, 4, 5, 6, -1, -2, 7, 8, 9]"
