Instance MethodFoundationEssentials
lastRange(of:in:)
iOS 8.0+
iPadOS 8.0+
Mac Catalyst 8.0+
macOS 10.10+
tvOS 9.0+
watchOS 2.0+
Returns the last found range of the type’s data buffer within the specified range.
func lastRange<D, R>(of data: D, in range: R) -> Range<Self.Index>? where D : DataProtocol, R : RangeExpression, Self.Index == R.Bound
Parameters
dataThe data sequence to find.
rangeA range to limit the scope of the search.
Return Value
The range, if found, of the last match of the provided data sequence.