CFStringReplace(_:_:_:)
Replaces part of the character contents of a CFMutableString object with another string.
Declaration
func CFStringReplace(_ theString: CFMutableString!, _ range: CFRange, _ replacement: CFString!)Parameters
- theString:
The string to modify. The characters are adjusted left or right (depending on the length of the substituted string) and the character buffer of the object is resized accordingly. If this value is not a CFMutableString object, an assertion is raised.
- range:
The range of characters in
theStringto replace. - replacement:
The replacement string to put into
theString.
Discussion
Although you can use this function to replace all characters in a CFMutableString object (by specifying a range of (0, CFStringGetLength(theString)) ), it is more convenient to use the CFStringReplaceAll(_:_:) function for that purpose.
See Also
CFMutableString Miscellaneous Functions
CFStringAppend(_:_:)CFStringAppendCharacters(_:_:_:)CFStringAppendCString(_:_:_:)CFStringAppendFormatAndArguments(_:_:_:_:)CFStringAppendPascalString(_:_:_:)CFStringCapitalize(_:_:)CFStringCreateMutable(_:_:)CFStringCreateMutableCopy(_:_:_:)CFStringCreateMutableWithExternalCharactersNoCopy(_:_:_:_:_:)CFStringDelete(_:_:)CFStringFindAndReplace(_:_:_:_:_:)CFStringFold(_:_:_:)CFStringInsert(_:_:_:)CFStringLowercase(_:_:)CFStringNormalize(_:_:)