---
title: "CFStringTokenizerCreate(_:_:_:_:_:)"
framework: corefoundation
role: symbol
role_heading: Function
path: "corefoundation/cfstringtokenizercreate(_:_:_:_:_:)"
---

# CFStringTokenizerCreate(_:_:_:_:_:)

Returns a tokenizer for a given string.

## Declaration

```swift
func CFStringTokenizerCreate(_ alloc: CFAllocator!, _ string: CFString!, _ range: CFRange, _ options: CFOptionFlags, _ locale: CFLocale!) -> CFStringTokenizer!
```

## Parameters

- `alloc`: The allocator to use to allocate memory for the new object. Pass NULL or doc://com.apple.corefoundation/documentation/CoreFoundation/kCFAllocatorDefault to use the current default allocator.
- `string`: The string to tokenize.
- `range`: The range of the characters in string to tokenize.
- `options`: A tokenization unit option that specifies how string should be tokenized. The options can be modified by adding unit modifier options to tell the tokenizer to prepare specified attributes when it tokenizes string. For possible values, see doc://com.apple.corefoundation/documentation/CoreFoundation/1588024-tokenization-modifiers.
- `locale`: A locale that specifies language- or region-specific behavior for the tokenization. You can pass NULL to use the default system locale, although this is typically not recommended—instead use doc://com.apple.corefoundation/documentation/CoreFoundation/CFLocaleCopyCurrent() to specify the locale of the current user. For more information, see doc://com.apple.corefoundation/documentation/CoreFoundation/1588024-tokenization-modifiers.

## Return Value

Return Value A tokenizer to analyze the range range of string for the given locale and options. Ownership follows the The Create Rule.
