Skip to content

Instance MethodFoundationInternationalization

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

input

An input string to match against.

index

The index within input at which to begin searching.

bounds

The bounds within input in 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.