Instance Method
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 given data buffer.
func lastRange<D, R>(of: D, in: R) -> Range<Self.Index>? where D : DataProtocol, R : RangeExpression, Self.Index == R.Bound
Parameters
ofThe data sequence to find.
inA range to limit the scope of the search.
Return Value
The range, if found, of the last match of the provided data sequence.
Discussion
A default implementation is given in terms of self.regions.
Default Implementations
DataProtocol Implementations
func lastRange<D, R>(of: D, in: R) -> Range<Self.Index>?Returns the last found range of the type’s data buffer within the specified range.