Instance Methodswift 6.0.1Swift
insert(_:at:)
mutating func insert(_ newElement: Base.Element, at i: Slice<Base>.Index)
mutating func insert(_ newElement: Base.Element, at i: Slice<Base>.Index)
where Base:RangeReplaceableCollection
import Swift
@frozen struct Slice<Base> where Base : Collection
A view into a subsequence of elements of another collection.
associatedtype Element where Self.Element == Self.Iterator.Element
A type representing the sequence’s elements.
protocol RangeReplaceableCollection<Element> : Collection where Self.SubSequence : RangeReplaceableCollection
A collection that supports replacement of an arbitrary subrange of elements with the elements of another collection.
init()
init<S>(_ elements: S) where S : Sequence, Base.Element == S.Element
init(repeating repeatedValue: Base.Element, count: Int)
mutating func insert<S>(contentsOf newElements: S, at i: Slice<Base>.Index) where S : Collection, Base.Element == S.Element
mutating func remove(at i: Slice<Base>.Index) -> Base.Element
mutating func removeSubrange(_ bounds: Range<Slice<Base>.Index>)
mutating func replaceSubrange<C>(_ subRange: Range<Slice<Base>.Index>, with newElements: C) where C : Collection, Base.Element == C.Element