---
title: "contains(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/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.appkit/documentation/AppKit/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(_:)](appkit/nstextrange/contains(_:)-5j4y2.md)
