CFMutableCharacterSet manages dynamic character sets. The basic interface for managing character sets is provided by CFCharacterSet. CFMutableCharacterSet adds functions to modify the contents of a character set.

You create a mutable character set object using either the CFCharacterSetCreateMutable or CFCharacterSetCreateMutableCopy function.

CFMutableCharacterSet is “toll-free bridged” with its Cocoa Foundation counterpart, NSMutableCharacterSet. This means that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object. Therefore, in a method where you see an NSMutableCharacterSet * parameter, you can pass in a CFMutableCharacterSetRef, and in a function where you see a CFMutableCharacterSetRef parameter, you can pass in an NSMutableCharacterSet instance. This capability also applies to concrete subclasses of NSMutableCharacterSet. See Toll-Free Bridged Types for more information on toll-free bridging.


Creating a Mutable Character Set


Creates a new empty mutable character set.


Creates a new mutable character set with the values from another character set.

Adding Characters


Adds a given range to a character set.


Adds the characters in a given string to a character set.

Removing Characters


Removes a given range of Unicode characters from a character set.


Removes the characters in a given string from a character set.

Logical Operations


Forms an intersection of two character sets.


Inverts the content of a given character set.


Forms the union of two character sets.

Data Types


A reference to a mutable character set object.

See Also

Opaque Types


The CFFileDescriptor provides an opaque type to monitor file descriptors for read and write activity via CFRunLoop.


CFStringTokenizer allows you to tokenize strings into words, sentences or paragraphs in a language-neutral way. It supports languages such as Japanese and Chinese that do not delimit words by spaces, as well as de-compounding German compounds. You can obtain Latin transcription for tokens. It also provides language identification API.