<!--
{
  "availability" : [
    "iOS: 18.0.0 -",
    "iPadOS: 18.0.0 -",
    "macCatalyst: 18.0.0 -",
    "macOS: 15.0.0 -",
    "tvOS: 18.0.0 -",
    "visionOS: 2.0.0 -",
    "watchOS: 11.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/RangeSet/contains(_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "Swift"
    ],
    "preciseIdentifier" : "s:s8RangeSetV8containsySbxF"
  },
  "title" : "contains(_:)"
}
-->

# contains(_:)

Returns a Boolean value indicating whether the given value is
contained by the ranges in the range set.

```
func contains(_ value: Bound) -> Bool
```

## Parameters

`value`

The value to look for in the range set.

## Return Value

`true` if `value` is contained by a range in the range set;
otherwise, `false`.

## Discussion> Complexity: O(log *n*), where *n* is the number of ranges in the
> range set.

---

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)