Returns a tokenizer for a given string.
SDKs
- iOS 3.0+
- macOS 10.5+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Foundation
Declaration
func CFStringTokenizerCreate(_ alloc: CFAllocator!, _ string: CFString!, _ range: CFRange, _ options: CFOption Flags, _ locale: CFLocale!) -> CFString Tokenizer!
Parameters
alloc
The allocator to use to allocate memory for the new object. Pass
NULL
ork
to use the current default allocator.CFAllocator Default 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 tokenizesstring
.For possible values, see 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 useCFLocale
to specify the locale of the current user.Copy Current() For more information, see Tokenization Modifiers.
Return Value
A tokenizer to analyze the range range
of string
for the given locale and options. Ownership follows the The Create Rule.