Inserts a string at a specified location in the character buffer of a CFMutableString object.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Core Foundation
Declaration
void CFStringInsert(CFMutable String Ref str, CFIndex idx, CFString Ref insertedStr);
Parameters
str
The string to be modified. If this value is not a CFMutableString object, an assertion is raised.
index
The index of the character in
str
after which the new characters are to be inserted. If the index is out of bounds, an assertion is raised.insertedStr
The string to insert into
str
.
Discussion
To accommodate the new characters, this function moves any existing characters to the right of the inserted characters the appropriate number of positions.