<!--
{
  "availability" : [
    "iOS: 8.0.0 -",
    "iPadOS: 8.0.0 -",
    "macCatalyst: 13.0.0 -",
    "macOS: 10.10.0 -",
    "tvOS: 9.0.0 -",
    "visionOS: 1.0.0 -",
    "watchOS: 2.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/PartialRangeThrough",
  "metadataVersion" : "0.1.0",
  "role" : "Structure",
  "symbol" : {
    "kind" : "Structure",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s19PartialRangeThroughV"
  },
  "title" : "PartialRangeThrough"
}
-->

# PartialRangeThrough

A partial interval up to, and including, an upper bound.

```
@frozen struct PartialRangeThrough<Bound> where Bound : Comparable
```

## Overview

You create `PartialRangeThrough` instances by using the prefix closed range
operator (prefix `...`).

```
let throughFive = ...5.0
```

You can use a `PartialRangeThrough` instance to quickly check if a value is
contained in a particular range of values. For example:

```
throughFive.contains(4.0)     // true
throughFive.contains(5.0)     // true
throughFive.contains(6.0)     // false
```

You can use a `PartialRangeThrough` instance of a collection’s indices to
represent the range from the start of the collection up to, and including,
the partial range’s upper bound.

```
let numbers = [10, 20, 30, 40, 50, 60, 70]
print(numbers[...3])
// Prints "[10, 20, 30, 40]"
```

## Relationships

### Conforms To

[`SendableMetatype`](/documentation/Swift/SendableMetatype)

[`Copyable`](/documentation/Swift/Copyable)

[`BitwiseCopyable`](/documentation/Swift/BitwiseCopyable)

[`CustomTestStringConvertible`](/documentation/Testing/CustomTestStringConvertible)

[`Encodable`](/documentation/Swift/Encodable)

[`Escapable`](/documentation/Swift/Escapable)

[`ConvertibleToBytes`](/documentation/Swift/ConvertibleToBytes)

[`RangeExpression`](/documentation/CoreAI/NDArray/RangeExpression)

[`MLTensorRangeExpression`](/documentation/CoreML/MLTensorRangeExpression)

[`RangeExpression`](/documentation/Swift/RangeExpression)

[`SliceIndex`](/documentation/Accelerate/BNNSGraph/Builder/SliceIndex)

[`Sendable`](/documentation/Swift/Sendable)

[`ConvertibleFromBytes`](/documentation/Swift/ConvertibleFromBytes)

[`Decodable`](/documentation/Swift/Decodable)

[`MLShapedArrayRangeExpression`](/documentation/CoreML/MLShapedArrayRangeExpression)

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)