Instance MethodFoundationEssentials
consuming(_:startingAt:in:)
iOS 16.0+
iPadOS 16.0+
Mac Catalyst 16.0+
macOS 13.0+
tvOS 16.0+
watchOS 9.0+
Processes the input string within the specified bounds, beginning at the given index, and returns the end position of the match and the produced output.
func consuming(_ input: String, startingAt index: String.Index, in bounds: Range<String.Index>) throws -> (upperBound: String.Index, output: Date)?
Parameters
inputAn input string to match against.
indexThe index within
inputat which to begin searching.boundsThe bounds within
inputin which to search.
Return Value
The upper bound where the match terminates and a matched instance, or nil if there isn’t a match.
Discussion
Don’t call this method directly. Regular expression matching and capture calls it automatically when matching substrings.