---
title: "+=(_:_:)"
framework: swift
role: symbol
role_heading: Operator
path: "swift/string/+=(_:_:)-676gx"
---

# +=(_:_:)

Appends the elements of a sequence to a range-replaceable collection.

## Declaration

```swift
static func += <Other>(lhs: inout Self, rhs: Other) where Other : Sequence, Self.Element == Other.Element
```

## Parameters

- `lhs`: The array to append to.
- `rhs`: A collection or finite sequence.

## Discussion

Discussion Use this operator to append the elements of a sequence to the end of range-replaceable collection with same Element type. This example appends the elements of a Range<Int> instance to an array of integers. var numbers = [1, 2, 3, 4, 5] numbers += 10...15 print(numbers) // Prints "[1, 2, 3, 4, 5, 10, 11, 12, 13, 14, 15]" note: O(m), where m is the length of the right-hand-side argument.

## See Also

### Appending Strings and Characters

- [append(_:)](swift/string/append(_:)-4xa8f.md)
- [append(_:)](swift/string/append(_:)-4xi3j.md)
- [append(contentsOf:)](swift/string/append(contentsof:)-oxek.md)
- [append(contentsOf:)](swift/string/append(contentsof:)-9vb4t.md)
- [append(contentsOf:)](swift/string/append(contentsof:)-7est5.md)
- [append(contentsOf:)](swift/string/append(contentsof:)-9foms.md)
- [reserveCapacity(_:)](swift/string/reservecapacity(_:).md)
- [+(_:_:)](swift/string/+(_:_:).md)
- [+=(_:_:)](swift/string/+=(_:_:).md)
- [+(_:_:)](swift/string/+(_:_:)-6h59y.md)
- [+(_:_:)](swift/string/+(_:_:)-n329.md)
- [+(_:_:)](swift/string/+(_:_:)-9fm57.md)
