---
title: "==(_:_:)"
framework: swift
role: symbol
role_heading: Operator
path: "swift/range/==(_:_:)"
---

# ==(_:_:)

Returns a Boolean value indicating whether two ranges are equal.

## Declaration

```swift
static func == (lhs: Range<Bound>, rhs: Range<Bound>) -> Bool
```

## Parameters

- `lhs`: A range to compare.
- `rhs`: Another range to compare.

## Discussion

Discussion Two ranges are equal when they have the same lower and upper bounds. That requirement holds even for empty ranges. let x = 5..<15 print(x == 5..<15) // Prints "true"

let y = 5..<5 print(y == 15..<15) // Prints "false"

## See Also

### Comparing Ranges

- [!=(_:_:)](swift/range/!=(_:_:).md)
- [overlaps(_:)](swift/range/overlaps(_:)-7osha.md)
- [overlaps(_:)](swift/range/overlaps(_:)-9fkb2.md)
