NSMutable class declares the programmatic interface to an object that manages a mutable string—that is, a string whose contents can be edited—that conceptually represents an array of Unicode characters. To construct and manage an immutable string—or a string that cannot be changed after it has been created—use an object of the
NSMutable class adds one primitive method—
replace—to the basic string-handling behavior inherited from
NSString. All other methods that modify a string work through this method. For example,
insert(_: simply replaces the characters in a range of
0 length, while
delete replaces the characters in a given range with no characters.