---
title: CFMutableCharacterSet
framework: corefoundation
role: symbol
role_heading: Class
path: corefoundation/cfmutablecharacterset
---

# CFMutableCharacterSet

## Declaration

```swift
class CFMutableCharacterSet
```

## Overview

Overview 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.

## Topics

### Creating a Mutable Character Set

- [CFCharacterSetCreateMutable(_:)](corefoundation/cfcharactersetcreatemutable(_:).md)
- [CFCharacterSetCreateMutableCopy(_:_:)](corefoundation/cfcharactersetcreatemutablecopy(_:_:).md)

### Adding Characters

- [CFCharacterSetAddCharactersInRange(_:_:)](corefoundation/cfcharactersetaddcharactersinrange(_:_:).md)
- [CFCharacterSetAddCharactersInString(_:_:)](corefoundation/cfcharactersetaddcharactersinstring(_:_:).md)

### Removing Characters

- [CFCharacterSetRemoveCharactersInRange(_:_:)](corefoundation/cfcharactersetremovecharactersinrange(_:_:).md)
- [CFCharacterSetRemoveCharactersInString(_:_:)](corefoundation/cfcharactersetremovecharactersinstring(_:_:).md)

### Logical Operations

- [CFCharacterSetIntersect(_:_:)](corefoundation/cfcharactersetintersect(_:_:).md)
- [CFCharacterSetInvert(_:)](corefoundation/cfcharactersetinvert(_:).md)
- [CFCharacterSetUnion(_:_:)](corefoundation/cfcharactersetunion(_:_:).md)

## Relationships

### Inherits From

- [CFCharacterSet](corefoundation/cfcharacterset.md)

### Conforms To

- [Equatable](swift/equatable.md)
- [Hashable](swift/hashable.md)

## See Also

### Related Documentation

- [String Programming Guide for Core Foundation](apple-archive/documentation/CoreFoundation/Conceptual/CFStrings/introCFStrings.html.md)

### Opaque Types

- [CFAllocator](corefoundation/cfallocator.md)
- [CFArray](corefoundation/cfarray.md)
- [CFAttributedString](corefoundation/cfattributedstring.md)
- [CFBag](corefoundation/cfbag.md)
- [CFBinaryHeap](corefoundation/cfbinaryheap.md)
- [CFBitVector](corefoundation/cfbitvector.md)
- [CFBoolean](corefoundation/cfboolean.md)
- [CFBundle](corefoundation/cfbundle.md)
- [CFCalendar](corefoundation/cfcalendar.md)
- [CFCharacterSet](corefoundation/cfcharacterset.md)
- [CFData](corefoundation/cfdata.md)
- [CFDate](corefoundation/cfdate.md)
- [CFDateFormatter](corefoundation/cfdateformatter.md)
- [CFDictionary](corefoundation/cfdictionary.md)
- [CFError](corefoundation/cferror.md)
