CFStringCreateMutable(_:_:)
Creates an empty CFMutableString object.
Declaration
func CFStringCreateMutable(_ alloc: CFAllocator!, _ maxLength: CFIndex) -> CFMutableString!Parameters
- alloc:
The allocator to use to allocate memory for the new string. Pass
NULLor kCFAllocatorDefault to use the current default allocator. - maxLength:
The maximum number of Unicode characters that can be stored by the returned string. Pass
0if there should be no character limit. Note that initially the string still has a length of0; this parameter simply specifies what the maximum size is. CFMutableString might try to optimize its internal storage by paying attention to this value.
Return Value
A new empty CFMutableString object or NULL if there was a problem creating the object. Ownership follows the The Create Rule.
Discussion
This function creates an empty (that is, content-less) CFMutableString object. You can add character data to this object with any of the CFStringAppend... functions, and thereafter you can insert, delete, replace, pad, and trim characters with the appropriate CFString functions. If the maxLength parameter is greater than 0, any attempt to add characters beyond this limit results in a run-time error.
See Also
CFMutableString Miscellaneous Functions
CFStringAppend(_:_:)CFStringAppendCharacters(_:_:_:)CFStringAppendCString(_:_:_:)CFStringAppendFormatAndArguments(_:_:_:_:)CFStringAppendPascalString(_:_:_:)CFStringCapitalize(_:_:)CFStringCreateMutableCopy(_:_:_:)CFStringCreateMutableWithExternalCharactersNoCopy(_:_:_:_:_:)CFStringDelete(_:_:)CFStringFindAndReplace(_:_:_:_:_:)CFStringFold(_:_:_:)CFStringInsert(_:_:_:)CFStringLowercase(_:_:)CFStringNormalize(_:_:)CFStringPad(_:_:_:_:)