# NSCharacterSet class reference

fedor@boulder.colorado.edu
rfm@gnu.org
Generated at 2025-12-02 21:52:00 +0000
1995, 1996, 1997, 1998 Free Software Foundation, Inc.
Software documentation for the NSCharacterSet class
Foundation/NSCharacterSet.h
NSCoding
NSCopying
NSMutableCopying
Represents a set of unicode characters. Used by NSScanner and NSString for parsing-related methods.
URLFragmentAllowedCharacterSet
Returns allowed characers for URL fragment component.
URLHostAllowedCharacterSet
Returns allowed characers for URL host component.
URLPasswordAllowedCharacterSet
Returns allowed characers for URL password component.
URLPathAllowedCharacterSet
Returns allowed characers for URL path component.
URLQueryAllowedCharacterSet
Returns allowed characers for URL query component.
URLUserAllowedCharacterSet
Returns allowed characers for URL USER component.
alphanumericCharacterSet
Returns a character set containing letters, numbers, and diacritical marks. Note that "letters" includes all alphabetic as well as Chinese characters, etc..
capitalizedLetterCharacterSet
Returns a character set containing letters in the unicode Titlecase category.
characterSetWithBitmapRepresentation:
data
Returns a character set containing characters as encoded in the data object (8192 bytes)
characterSetWithCharactersInString:
aString
Returns set with characters in aString, or empty set for empty string. Raises an exception if given a `nil` string.
characterSetWithContentsOfFile:
aFile
Initializes from a bitmap (8192 bytes representing 65536 values).
Each bit set in the bitmap represents the fact that a character at that position in the unicode base plane exists in the characterset.
File must have extension " `.bitmap` ". To get around this load the file into data yourself and use [NSCharacterSet -characterSetWithBitmapRepresentation].
characterSetWithRange:
aRange
Returns set containing unicode index range given by aRange.
controlCharacterSet
Returns a character set containing control and format characters.
decimalDigitCharacterSet
Returns a character set containing characters that represent the decimal digits 0 through 9.
decomposableCharacterSet
Returns a character set containing individual characters that can be represented also by a composed character sequence.
illegalCharacterSet
Returns a character set containing unassigned and explicitly illegal character values.
letterCharacterSet
Returns a character set containing letters, including all alphabetic as well as Chinese characters, etc..
lowercaseLetterCharacterSet
Returns a character set that contains the lowercase characters. This set does not include caseless characters, only those that have corresponding characters in uppercase and/or titlecase.
newlineCharacterSet
Returns a character set containing the newline characters, values 0x000A and 0x000D and nextline 0x0085 character.
nonBaseCharacterSet
Returns a character set containing characters for diacritical marks, which are usually only rendered in conjunction with another character.
punctuationCharacterSet
Returns a character set containing punctuation marks.
symbolCharacterSet
Returns a character set containing mathematical symbols, etc..
uppercaseLetterCharacterSet
Returns a character set that contains the uppercase characters. This set does not include caseless characters, only those that have corresponding characters in lowercase and/or titlecase.
whitespaceAndNewlineCharacterSet
Returns a character set that contains the whitespace characters, plus the newline characters, values 0x000A and 0x000D and nextline 0x0085 character.
whitespaceCharacterSet
Returns a character set that contains the whitespace characters.
bitmapRepresentation
Returns a bitmap representation of the receiver's character set (suitable for archiving or writing to a file), in an NSData object.
characterIsMember:
aCharacter
Returns `YES` if the receiver contains aCharacter, `NO` if it does not.
hasMemberInPlane:
aPlane
Returns `YES` if the receiver contains at least one character in the specified unicode plane.
invertedSet
Returns a character set containing only characters that the receiver does not contain.
isSupersetOfSet:
aSet
Returns `YES` is all the characters in aSet are present in the receiver.
longCharacterIsMember:
aCharacter
Returns `YES` is the specified 32-bit character is present in the receiver.
Software documentation for the NSMutableCharacterSet class
Foundation/NSCharacterSet.h
An NSCharacterSet that can be modified.
addCharactersInRange:
aRange
Adds characters specified by unicode indices in aRange to set.
addCharactersInString:
aString
Adds characters in aString to set.
formIntersectionWithCharacterSet:
otherSet
Set intersection of character sets.
formUnionWithCharacterSet:
otherSet
Set union of character sets.
invert
Remove all characters currently in set and add all other characters.
removeCharactersInRange:
aRange
Drop given range of characters. No error for characters not currently in set.
removeCharactersInString:
aString
Drop characters in aString. No error for characters not currently in set.