---
title: "contains(_:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/nstextrange/contains(_:)-7hvi0"
---

# contains(_:)

Determines if the text location you specify is in the current text range.

## Declaration

```swift
func contains(_ location: any NSTextLocation) -> Bool
```

## Parameters

- `location`: An doc://com.apple.uikit/documentation/UIKit/NSTextLocation.

## Return Value

Return Value Returns true if the location is in the range otherwise false .

## See Also

### Finding text within the text range

- [contains(_:)](uikit/nstextrange/contains(_:)-5j4y2.md)
