---
title: "contains(_:)"
framework: appkit
role: symbol
role_heading: Instance Method
path: "appkit/nstextrange/contains(_:)-5j4y2"
---

# contains(_:)

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

## Declaration

```swift
func contains(_ textRange: NSTextRange) -> Bool
```

## Parameters

- `textRange`: An doc://com.apple.appkit/documentation/AppKit/NSTextRange.

## Return Value

Return Value Returns true if the range you provide is in the current range; otherwise false.

## See Also

### Finding text within the text range

- [contains(_:)](appkit/nstextrange/contains(_:)-7hvi0.md)
