Enlarges a string, padding it with specified characters, or truncates the string.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
- Core Foundation
The string to modify.
A string containing the characters with which to fill the extended character buffer. Pass
NULLto truncate the string.
The new length of
the. If this length is greater than the current length, padding takes place; if it is less, truncation takes place.
The index of the character in
padwith which to begin padding. If you are truncating the string represented by the object, this parameter is ignored.
This function has two purposes. It either enlarges the character buffer of a CFMutableString object to a given length, padding the added length with a given character or characters, or it truncates the character buffer to a smaller size. The key parameter for this behavior is
length; if it is greater than the current length of the represented string, padding takes place, and if it less than the current length, truncation occurs.
For example, say you have a string,
a, containing the characters "abcdef". The call
a containing "abcdef231". However, the following call
a containing "abc".