---
title: "tokensForRange:"
framework: naturallanguage
role: symbol
role_heading: Instance Method
path: "naturallanguage/nltokenizer/tokensforrange:"
---

# tokensForRange:

Tokenizes the string within the provided range.

## Declaration

```occ
- (NSArray<NSValue *> *) tokensForRange:(NSRange) range;
```

## Parameters

- `range`: The range within the string that should be tokenzied.

## Return Value

Return Value Returns the ranges corresponding to the tokens for the tokenizer’s unit that intersect the given range.

## See Also

### Enumerating the tokens

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