CFStringReplace |
||||
Header: | CFString.h | Carbon status: | Supported | |
Replaces part of the character contents of a mutable CFString object with another string.
void CFStringReplace ( CFMutableStringRef theString, CFRange range, CFStringRef replacement );
Pass a reference to the mutable CFString object with characters that need to be replaced. The function raises an assertion if the CFString object is not mutable.
Pass a structure of type CFRange that specifies the range of characters in the mutable CFString object to replace.
Pass a reference to a CFString object containing the characters that are to replace the range of characters specified by the first two parameters.
The CFStringReplace function substitutes a string (represented by a CFString object) for a given range of characters in a mutable CFString object. The characters in the modified object are adjusted left or right (depending on the length of the substituted string) and the character buffer of the object is resized accordingly. Although you can use this function to replace all characters in the mutable CFString (by specifying a range of (0, CFStringGetLenth(theString))), it is more convenient to use the CFStringReplaceAll function for this purpose.
Supported in Carbon. Available in Carbon 1.0.2 and later.
© 2000 Apple Computer, Inc. (Last Updated 6/30/2000)