A string which can be changed. More...
#import <Foundation/Foundation.h>


Instance Methods | |
| (id) | - initWithCapacity: |
| Initializes an empty string, with room for a number of bytes. | |
| (id) | - copy |
| Returns a string, which can't be changed, with the same contents, or nil if there isn't enough memory. More... | |
| (size_t) | - capacity |
| Returns the length that the string can be before it needs more memory. | |
| (BOOL) | - appendString: |
| Appends another string, which can be this one. More... | |
| (BOOL) | - appendCString: |
| Appends a null-terminated string. More... | |
| (BOOL) | - appendFormat: |
| Appends what's made from a format and arguments, which can include this string. | |
| (void) | - trimWhitespace |
| Removes whitespace from the start and end: Unicode's spaces, such as tabs, line endings, no-break, em and ideographic spaces, but not zero width spaces. | |
| (BOOL) | - trimPrefix: |
| Removes another string from the start, and returns YES, if this starts with it. More... | |
| (BOOL) | - trimSuffix: |
| Removes another string from the end, and returns YES, if this ends with it. More... | |
| (void) | - toUppercase |
| Changes letters to uppercase, if they're in the Latin-1 character set. | |
| (void) | - toLowercase |
| Changes letters to lowercase, if they're in the Latin-1 character set. | |
Instance Methods inherited from NXString | |
| (id) | - initWithBytes:length: |
| Initializes a string with a number of bytes, or those before the first which is zero. | |
| (id) | - initWithString: |
| Initializes a string with the contents of another, which is empty if that's nil. | |
| (id) | - initWithQuotedString: |
| Initializes a string from one in quotes, with its escapes decoded. | |
| (id) | - initWithCString: |
| Initializes a string with the contents of a null-terminated string, which is empty if that's NULL. | |
| (id) | - initWithFormat: |
| Initializes a string with a format and arguments. | |
| (id) | - initWithFormat:arguments: |
| Initializes a string with a format and a list of arguments. | |
| (size_t) | - length |
| Returns the length in bytes, which doesn't include the null terminator. | |
| (const char *) | - cStr |
| Returns the contents, as a null-terminated string. More... | |
| (size_t) | - runeCount |
| Returns the number of runes, which are Unicode code points. | |
| (BOOL) | - isEqual: |
| Returns YES if the other object is a string with the same contents, whatever kind it is. | |
| (uintptr_t) | - hash |
| Returns a hash of the contents, which is the same for equal strings. | |
| (NXComparisonResult) | - compare: |
| Compares the string with another, byte by byte. More... | |
| (BOOL) | - hasPrefix: |
| Returns YES if the string starts with another, as it does with nil or an empty string. | |
| (BOOL) | - hasSuffix: |
| Returns YES if the string ends with another, as it does with nil or an empty string. | |
| (BOOL) | - containsString: |
| Returns YES if the string has another in it, as it does nil or an empty string. | |
| (size_t) | - indexOfSubstring: |
| Returns the index, in bytes, of the first place that another string is in this one, or NXNotFound. More... | |
| (NXArray *) | - componentsSeparatedByString: |
| Returns the parts of the string between a separator, as new strings. More... | |
| (NXArray *) | - componentsSeparatedByWhitespace |
| Returns the words of the string, which are between runs of whitespace, as new strings. More... | |
| (NXString *) | - description |
| Returns the string itself. | |
Instance Methods inherited from NXObject | |
| (void) | - dealloc |
| Frees the instance. More... | |
| (NXZone *) | - zone |
| Returns the zone in which the instance was allocated. More... | |
| (id) | - retain |
| Increases the retain count of the receiver. More... | |
| (void) | - release |
| Decreases the retain count of the receiver. More... | |
| (id) | - autorelease |
| Releases the receiver later, when the current autorelease pool of the thread is drained. More... | |
Instance Methods inherited from Object | |
| (id) | - init |
| Initialize the instance, after allocation. More... | |
| (Class) | - class |
| Returns the class of the instance. More... | |
| (Class) | - superclass |
| Returns the superclass of the instance. More... | |
| (BOOL) | - isKindOfClass: |
| Returns a Boolean value that indicates whether the receiver is an instance of a given class. More... | |
| (BOOL) | - conformsTo: |
| Checks if the receiver's class conforms to a protocol. More... | |
Instance Methods inherited from <ObjectProtocol> | |
| (BOOL) | - respondsToSelector: |
| Checks if the receiver responds to a selector. More... | |
Class Methods | |
| (id) | + stringWithCapacity: |
| Returns an empty string, with room for a number of bytes. | |
Class Methods inherited from NXString | |
| (id) | + string |
| Returns an empty string. | |
| (id) | + stringWithString: |
| Returns a string with the contents of another, which is empty if that's nil. | |
| (id) | + stringWithCString: |
| Returns a string with the contents of a null-terminated string, which is empty if that's NULL. | |
| (id) | + stringWithFormat: |
| Returns a string made from a format and arguments. | |
| (id) | + stringWithQuotedString: |
| Returns a string from one in quotes, with its escapes decoded, or nil if it isn't one. More... | |
Class Methods inherited from NXObject | |
| (id) | + alloc |
| Allocates a new instance in the default zone, or if there isn't one, with sys_calloc(). More... | |
| (id) | + allocWithZone: |
| Allocates a new instance in a specific zone. More... | |
| (id) | + new |
| Allocates and initializes a new instance, as [[cls alloc] init] does. More... | |
Class Methods inherited from Object | |
| (void) | + initialize |
| Performs one-time initialization for the class. More... | |
| (Class) | + class |
| Returns the class object. More... | |
| (Class) | + superclass |
| Returns the superclass of the class. More... | |
| (const char *) | + name |
| Returns the name of the class. More... | |
| (BOOL) | + conformsTo: |
| Checks if the class conforms to a protocol. More... | |
Additional Inherited Members | |
Protected Attributes inherited from Object | |
| Class | isa |
| A pointer to the object's class structure. More... | |
A string which can be changed.
Any number of threads can read it at once, but while one changes it, no other thread can use it, and it doesn't lock itself. See Threads and mutable objects.
Methods which make the string longer return NO if there isn't enough memory, and don't change it.
Definition at line 18 of file NXMutableString.h.
| - (BOOL) appendCString: | (const char *) | cStr |
Appends a null-terminated string.
Nothing is done if it's NULL.
Appends another string, which can be this one.
Nothing is done if it's nil.
| - (id) copy |
Returns a string, which can't be changed, with the same contents, or nil if there isn't enough memory.
The caller owns it and has to release it.
Implements NXObject.
Removes another string from the start, and returns YES, if this starts with it.
Nothing is done, and it returns NO, if that's nil or empty.
Removes another string from the end, and returns YES, if this ends with it.
Nothing is done, and it returns NO, if that's nil or empty.