---
title: "contains(_:)"
framework: swift
role: symbol
role_heading: Instance Method
path: "swift/range/contains(_:)-76nb4"
---

# contains(_:)

Returns a Boolean value indicating whether the given element is contained within the range.

## Declaration

```swift
func contains(_ element: Bound) -> Bool
```

## Parameters

- `element`: The element to check for containment.

## Return Value

Return Value true if element is contained in the range; otherwise, false.

## Discussion

Discussion Because Range represents a half-open range, a Range instance does not contain its upper bound. element is contained in the range if it is greater than or equal to the lower bound and less than the upper bound.
