Creates a mutable copy of a string.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The allocator to use to allocate memory for the new string. Pass
NULLor kCFAllocatorDefault to use the current default allocator.
The maximum number of Unicode characters that can be stored by the returned object. Pass
0if there should be no character limit. Note that initially the returned object still has the same length as the string argument; this parameter simply specifies what the maximum size is. CFString might try to optimize its internal storage by paying attention to this value.
A string to copy.
A string that has the same contents as
NULL if there was a problem copying the object. Ownership follows the The Create Rule.
The returned mutable string is identical to the original string except for (perhaps) the mutability attribute. You can add character data to the returned string with any of the
CFString functions, and you can insert, delete, replace, pad, and trim characters with the appropriate CFString functions. If the
max parameter is greater than
0, any attempt to add characters beyond this limit results in a run-time error.