<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/Array/RangeReplaceableCollection-Implementations",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "RangeReplaceableCollection Implementations"
}
-->

# RangeReplaceableCollection Implementations

## Topics

### Operators

[`static func + <Other>(Other, Self) -> Self`](/documentation/Swift/Array/+(_:_:)-6h58k)

Creates a new collection by concatenating the elements of a sequence and a
collection.

[`static func + <Other>(Self, Other) -> Self`](/documentation/Swift/Array/+(_:_:)-9fm5l)

Creates a new collection by concatenating the elements of two collections.

[`static func + <Other>(Self, Other) -> Self`](/documentation/Swift/Array/+(_:_:)-n33n)

Creates a new collection by concatenating the elements of a collection and
a sequence.

[`static func += <Other>(inout Self, Other)`](/documentation/Swift/Array/+=(_:_:)-676ib)

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

### Initializers

[`init()`](/documentation/Swift/Array/init())

Creates a new, empty array.

[`init<S>(S)`](/documentation/Swift/Array/init(_:)-1ip9h)

Creates a new instance of a collection containing the elements of a
sequence.

[`init(repeating: Element, count: Int)`](/documentation/Swift/Array/init(repeating:count:))

Creates a new array containing the specified number of a single, repeated
value.

[`init(repeating: Self.Element, count: Int)`](/documentation/Swift/Array/init(repeating:count:)-5y5f0)

Creates a new collection containing the specified number of a single,
repeated value.

### Instance Methods

[`func append(Element)`](/documentation/Swift/Array/append(_:))

Adds a new element at the end of the array.

[`func append(Self.Element)`](/documentation/Swift/Array/append(_:)-1re55)

Adds an element to the end of the collection.

[`func append<S>(contentsOf: S)`](/documentation/Swift/Array/append(contentsOf:))

Adds the elements of a sequence to the end of the array.

[`func append<S>(contentsOf: S)`](/documentation/Swift/Array/append(contentsOf:)-9foli)

Adds the elements of a sequence or collection to the end of this
collection.

[`func applying(CollectionDifference<Self.Element>) -> Self?`](/documentation/Swift/Array/applying(_:))

Applies the given difference to this collection.

[`func filter<E>((Self.Element) throws(E) -> Bool) throws(E) -> Self`](/documentation/Swift/Array/filter(_:)-66nut)

Returns a new collection of the same type containing, in order, the
elements of the original collection that satisfy the given predicate.

[`func insert(Self.Element, at: Self.Index)`](/documentation/Swift/Array/insert(_:at:)-88yqz)

Inserts a new element into the collection at the specified position.

[`func insert<C>(contentsOf: C, at: Self.Index)`](/documentation/Swift/Array/insert(contentsOf:at:))

Inserts the elements of a sequence into the collection at the specified
position.

[`func popLast() -> Self.Element?`](/documentation/Swift/Array/popLast())

Removes and returns the last element of the collection.

[`func remove(at: Self.Index) -> Self.Element`](/documentation/Swift/Array/remove(at:)-5g0x0)

Removes and returns the element at the specified position.

[`func removeAll(keepingCapacity: Bool)`](/documentation/Swift/Array/removeAll(keepingCapacity:))

Removes all elements from the array.

[`func removeAll(keepingCapacity: Bool)`](/documentation/Swift/Array/removeAll(keepingCapacity:)-6xw8v)

Removes all elements from the collection.

[`func removeAll(where: (Self.Element) throws -> Bool) rethrows`](/documentation/Swift/Array/removeAll(where:)-5k61r)

Removes all the elements that satisfy the given predicate.

[`func removeAll(where: (Self.Element) throws -> Bool) rethrows`](/documentation/Swift/Array/removeAll(where:)-6bd6r)

Removes all the elements that satisfy the given predicate.

[`func removeFirst() -> Self.Element`](/documentation/Swift/Array/removeFirst())

Removes and returns the first element of the collection.

[`func removeFirst(Int)`](/documentation/Swift/Array/removeFirst(_:))

Removes the specified number of elements from the beginning of the
collection.

[`func removeLast() -> Self.Element`](/documentation/Swift/Array/removeLast())

Removes and returns the last element of the collection.

[`func removeLast(Int)`](/documentation/Swift/Array/removeLast(_:))

Removes the specified number of elements from the end of the
collection.

[`func removeSubrange(Range<Self.Index>)`](/documentation/Swift/Array/removeSubrange(_:)-8may1)

Removes the elements in the specified subrange from the collection.

[`func removeSubrange<R>(R)`](/documentation/Swift/Array/removeSubrange(_:)-9twou)

Removes the elements in the specified subrange from the collection.

[`func removeSubranges(RangeSet<Self.Index>)`](/documentation/Swift/Array/removeSubranges(_:)-5xi38)

Removes the elements at the given indices.

[`func replaceSubrange<C>(Range<Int>, with: C)`](/documentation/Swift/Array/replaceSubrange(_:with:))

Replaces a range of elements with the elements in the specified
collection.

[`func replaceSubrange<C>(Range<Self.Index>, with: C)`](/documentation/Swift/Array/replaceSubrange(_:with:)-3hkdk)

Replaces the specified subrange of elements with the given collection.

[`func replaceSubrange<C, R>(R, with: C)`](/documentation/Swift/Array/replaceSubrange(_:with:)-7293p)

Replaces the specified subrange of elements with the given collection.

[`func reserveCapacity(Int)`](/documentation/Swift/Array/reserveCapacity(_:)-8lw3t)

Prepares the collection to store the specified number of elements, when
doing so is appropriate for the underlying type.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)