---
title: PartialRangeUpTo
framework: swift
role: symbol
role_heading: Structure
path: swift/partialrangeupto
---

# PartialRangeUpTo

A partial half-open interval up to, but not including, an upper bound.

## Declaration

```swift
@frozen struct PartialRangeUpTo<Bound> where Bound : Comparable
```

## Overview

Overview You create PartialRangeUpTo instances by using the prefix half-open range operator (prefix ..<). let upToFive = ..<5.0 You can use a PartialRangeUpTo instance to quickly check if a value is contained in a particular range of values. For example: upToFive.contains(3.14)       // true upToFive.contains(6.28)       // false upToFive.contains(5.0)        // false You can use a PartialRangeUpTo instance of a collection’s indices to represent the range from the start of the collection up to, but not including, the partial range’s upper bound. let numbers = [10, 20, 30, 40, 50, 60, 70] print(numbers[..<3]) // Prints "[10, 20, 30]"

## Topics

### Initializers

- [init(_:)](swift/partialrangeupto/init(_:).md)

### Instance Properties

- [upperBound](swift/partialrangeupto/upperbound.md)

### Default Implementations

- [Decodable Implementations](swift/partialrangeupto/decodable-implementations.md)
- [Encodable Implementations](swift/partialrangeupto/encodable-implementations.md)
- [RangeExpression Implementations](swift/partialrangeupto/rangeexpression-implementations.md)

## Relationships

### Conforms To

- [BNNSGraph.Builder.SliceIndex](accelerate/bnnsgraph/builder/sliceindex.md)
- [Copyable](swift/copyable.md)
- [CustomTestStringConvertible](testing/customteststringconvertible.md)
- [Decodable](swift/decodable.md)
- [Encodable](swift/encodable.md)
- [Escapable](swift/escapable.md)
- [MLShapedArrayRangeExpression](coreml/mlshapedarrayrangeexpression.md)
- [MLTensorRangeExpression](coreml/mltensorrangeexpression.md)
- [NDArray.RangeExpression](coreai/ndarray/rangeexpression.md)
- [RangeExpression](swift/rangeexpression.md)
- [Sendable](swift/sendable.md)
- [SendableMetatype](swift/sendablemetatype.md)

## See Also

### Range Expressions

- [PartialRangeThrough](swift/partialrangethrough.md)
- [PartialRangeFrom](swift/partialrangefrom.md)
- [RangeExpression](swift/rangeexpression.md)
- [UnboundedRange_](swift/unboundedrange_.md)
