---
title: "tokenRangeForRange:"
framework: naturallanguage
role: symbol
role_heading: Instance Method
path: "naturallanguage/nltokenizer/tokenrangeforrange:"
---

# tokenRangeForRange:

Finds the entire range of all tokens contained completely or partially within the specified range.

## Declaration

```occ
- (NSRange) tokenRangeForRange:(NSRange) range;
```

## Parameters

- `range`: The range within the string to search for tokens.

## Return Value

Return Value The smallest possible range that contains all of the tokens within the range specified in range. This result includes a token’s entire range if any part of that token is included within range. If the length of range is 0, this return value is equivalent to tokenRangeAtIndex:.

## See Also

### Enumerating the tokens

- [enumerateTokensInRange:usingBlock:](naturallanguage/nltokenizer/enumeratetokensinrange:usingblock:.md)
- [tokensForRange:](naturallanguage/nltokenizer/tokensforrange:.md)
- [tokenRangeAtIndex:](naturallanguage/nltokenizer/tokenrangeatindex:.md)
