Instance Subscript (Default implementation)swift 6.1.2Swift

subscript(_:)

Accesses a view of this collection with the elements at the given indices.

iOS
18.0+
macOS
15.0+
tvOS
18.0+
visionOS
2.0+
watchOS
11.0+
subscript(subranges: RangeSet<Self.Index>) -> DiscontiguousSlice<Self> { get }

Parameters

subranges

The indices of the elements to retrieve from this collection.

Returns

A collection of the elements at the positions in subranges.