Instance MethodFoundationEssentials
replaceSubrange(_:with:)
iOS 15.0+
iPadOS 15.0+
Mac Catalyst 15.0+
macOS 12.0+
tvOS 15.0+
watchOS 8.0+
Replaces the contents in a range of the attributed string.
mutating func replaceSubrange(_ range: some RangeExpression<AttributedString.Index>, with s: some AttributedStringProtocol)
Parameters
rangeThe range of the attributed string to replace.
sThe string to insert in place of the replaced range.