Instance Methodswift 6.0.3Swift
replaceSubrange(_:with:)
mutating func replaceSubrange<C>(_ subRange: Range<Slice<Base>.Index>, with newElements: C) where C : Collection, Base.Element == C.Element
mutating func replaceSubrange<C>(_ subRange: Range<Slice<Base>.Index>, with newElements: C) where C : Collection, Base.Element == C.Element
ss5SliceVsSmRzrlE15replaceSubrange_4withySny5IndexQzG_qd__tSlRd__7ElementQyd__AHRtzlF
What are these?ZWFK
where Base:RangeReplaceableCollection
import Swift
@frozen struct Slice<Base> where Base : Collection
A view into a subsequence of elements of another collection.
@frozen struct Range<Bound> where Bound : Comparable
A half-open interval from a lower bound up to, but not including, an upper bound.
protocol Collection<Element> : Sequence
A sequence whose elements can be traversed multiple times, nondestructively, and accessed by an indexed subscript.
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(_ newElement: Base.Element, at i: Slice<Base>.Index)
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>)