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


static func ..< (minimum: Unicode.Scalar, maximum: Unicode.Scalar) -> Range<Unicode.Scalar>



The lower bound for the range.


The upper bound for the range.


Use the half-open range operator (..<) to create a range of any type that conforms to the Comparable protocol. This example creates a Range<Double> from zero up to, but not including, 5.0.

let lessThanFive = 0.0..<5.0
print(lessThanFive.contains(3.14))  // Prints "true"
print(lessThanFive.contains(5.0))   // Prints "false"

See Also

Creating Ranges of Scalars

static func ... (Unicode.Scalar) -> PartialRangeFrom<Unicode.Scalar>

Returns a partial range extending upward from a lower bound.

static func ... (Unicode.Scalar) -> PartialRangeThrough<Unicode.Scalar>

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

static func ... (Unicode.Scalar, Unicode.Scalar) -> ClosedRange<Unicode.Scalar>

Returns a closed range that contains both of its bounds.

static func ..< (Unicode.Scalar) -> PartialRangeUpTo<Unicode.Scalar>

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