Platforms to show: All Mac Windows Linux Cross-Platform

NSMutableCharacterSetMBS class

Superclass: NSCharacterSetMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
class Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
The NSMutableCharacterSet class declares the programmatic interface to objects that manage a modifiable set of Unicode characters.
Example
// build a character set for valid file name characters and split a text with it
Var allowed As New NSMutableCharacterSetMBS
allowed.addCharactersInString "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_."
allowed.invert // now everything else

Var parts() As String = allowed.componentsSeparatedByCharactersInSet("My Report: 2025/06 (final).pdf")
MessageBox String.FromArray(parts, "_")

You can add or remove characters from a mutable character set as numeric values in NSRange structures or as character values in strings, combine character sets by union or intersection, and invert a character set.

Mutable character sets are less efficient to use than immutable character sets. If you don't need to change a character set after creating it, create an immutable copy with copy and use that.

NSMutableCharacterSet defines no primitive methods. Subclasses must implement all methods declared by this class in addition to the primitives of NSCharacterSet. They must also implement mutableCopy.
Subclass of the NSCharacterSetMBS class.

Superclass NSCharacterSetMBS

Constants

Constant Value Description
NSOpenStepUnicodeReservedBase &hF400 A constant to specify lower bound for a Unicode character range reserved for Apple's corporate use. Specifies lower bound for a Unicode character range reserved for Apple's corporate use (the range is 0xF400–0xF8FF).

This class has no subclasses.

Blog Entries

Xojo Developer Magazine

Some methods using this class:

Some related classes:


The items on this page are in the following plugins: MBS MacBase Plugin.


NSMutableAttributedStringMBS   -   NSMutableIndexSetMBS


The biggest plugin in space...