Operator

...(_:_:)

Returns a closed range that contains both of its bounds.

Declaration

Parameters

minimum

The lower bound for the range.

maximum

The upper bound for the range.

Discussion

Use the closed range operator (...) to create a closed range of any type that conforms to the Comparable protocol. This example creates a ClosedRange<Character> from “a” up to, and including, “z”.

let lowercase = "a"..."z"
print(lowercase.contains("z"))
// Prints "true"

See Also

Creating Ranges

static func ... (RunLoop.SchedulerTimeType) -> PartialRangeFrom<RunLoop.SchedulerTimeType>

Returns a partial range extending upward from a lower bound.

static func ... (RunLoop.SchedulerTimeType) -> PartialRangeThrough<RunLoop.SchedulerTimeType>

Returns a partial range up to, and including, its upper bound.

static func ..< (RunLoop.SchedulerTimeType) -> PartialRangeUpTo<RunLoop.SchedulerTimeType>

Returns a partial range up to, but not including, its upper bound.

static func ..< (RunLoop.SchedulerTimeType, RunLoop.SchedulerTimeType) -> Range<RunLoop.SchedulerTimeType>

Returns a half-open range that contains its lower bound but not its upper bound.