Platforms to show: All Mac Windows Linux Cross-Platform

Back to NSCharacterSetMBS class.

NSCharacterSetMBS.bitmapRepresentation as MemoryBlock

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a memoryblock object encoding the receiver in binary format.

This format is suitable for saving to a file or otherwise transmitting or archiving.
A raw bitmap representation of a character set is a byte array of 2^16 bits (that is, 8192 bytes). The value of the bit at position n represents the presence in the character set of the character with decimal Unicode value n.

NSCharacterSetMBS.characterIsMember(Character as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a Boolean value that indicates whether a given character is in the receiver.
Example
// get the Symbol font
dim n as NSFontMBS = NSFontMBS.fontWithName("Arial",10)

// what characters are defined for this font?
dim c as NSCharacterSetMBS = n.coveredCharacterSet

// is letter A part of this font?
MsgBox "A included: "+str(c.characterIsMember(asc("A")))

NSCharacterSetMBS.componentsSeparatedByCharactersInSet(s as string) as String()

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 15.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns an array containing substrings from the receiver that have been divided by characters in a given set.

self: A character set containing the characters to to use to split the receiver. Must not be nil.
s: The text to process.

Returns an array of string containing substrings from the receiver that have been divided by characters in separator.

The substrings in the array appear in the order they did in the receiver. Adjacent occurrences of the separator characters produce empty strings in the result. Similarly, if the string begins or ends with separator characters, the first or last substring, respectively, is empty.

NSCharacterSetMBS.Constructor

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
The constructor to create an empty character set.

NSCharacterSetMBS.copy as NSCharacterSetMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a copy of the character set.

NSCharacterSetMBS.hasMemberInPlane(thePlane as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a Boolean value that indicates whether the receiver has at least one member in a given character plane.

This method makes it easier to find the plane containing the members of the current character set. The Basic Multilingual Plane is plane 0.

NSCharacterSetMBS.invertedSet as NSCharacterSetMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a character set containing only characters that don't exist in the receiver.

Inverting an immutable character set is much more efficient than inverting a mutable character set.

NSCharacterSetMBS.isSupersetOfSet(theOtherSet as NSCharacterSetMBS) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a Boolean value that indicates whether the receiver is a superset of another given character set.

Returns true if the receiver is a superset of theOtherSet, otherwise false.
Available in Mac OS X v10.2 and later.

NSCharacterSetMBS.longCharacterIsMember(theLongChar as Integer) as boolean

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a Boolean value that indicates whether a given long character is a member of the receiver.

Returns true if theLongChar is in the receiver, otherwise false.
This method supports the specification of 32-bit characters.
Available in Mac OS X v10.2 and later.

NSCharacterSetMBS.mutableCopy as NSMutableCharacterSetMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Creates a mutable copy of the characterset.

NSCharacterSetMBS.Operator_Convert as string

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 9.6 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a string containing all characters in this set.
Example
dim r as NSRangeMBS = NSMakeRangeMBS(asc("a"),26) // all small letters
dim n as NSCharacterSetMBS = NSCharacterSetMBS.characterSetWithRange(r)
MsgBox n

This way you can use a characterset directly with functions expecting a string like msgbox.

NSCharacterSetMBS.rangeOfCharacterFromSet(s as string, options as Integer = 0, searchRange as NSRangeMBS = nil) as NSRangeMBS

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 15.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Finds and returns the range in the receiver of the first character from a given character set found in a given range with given options.

self: A character set. This value must not be nil.
s: The text to process:
options: A mask specifying search options. The following options may be specified by combining them with bitwise OR operator: NSAnchoredSearch (8), NSBackwardsSearch (4).
searchRange: Optional, the range in which to search. The range must not exceed the bounds of the receiver.

Raises a NSException if search range is invalid.

Returns the range in the receiver of the first character found from set within search range. Returns a range of {NSNotFound, 0} if none of the characters in aSet are found.

Because pre-composed characters in set can match composed character sequences in the receiver, the length of the returned range can be greater than 1. For example, if you search for "ü" in the string "stru¨del", the returned range is {3,2}.

Special Considerations
This method detects all invalid ranges (including those with negative lengths). For applications linked against OS X v10.6 and later, this error causes an exception; for applications linked against earlier releases, this error causes a warning, which is displayed just once per application execution.

NSCharacterSetMBS.stringByTrimmingCharactersInSet(s as string) as String

Type Topic Plugin Version macOS Windows Linux iOS Targets
method Cocoa MBS MacBase Plugin 15.1 ✅ Yes ❌ No ❌ No ✅ Yes All
Returns a new string made by removing from both ends of the receiver characters contained in a given character set.

Retruns a new string made by removing from both ends of the receiver characters contained in set. If the receiver is composed entirely of characters from set, the empty string is returned.

Use whitespaceCharacterSet or whitespaceAndNewlineCharacterSet to remove whitespace around strings.

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


The biggest plugin in space...