<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFMutableString",
  "metadataVersion" : "0.1.0",
  "role" : "Class",
  "symbol" : {
    "kind" : "Class",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@T@CFMutableStringRef"
  },
  "title" : "CFMutableString"
}
-->

# CFMutableString

```
class CFMutableString
```

## Overview

CFMutableString manages dynamic strings. The basic interface for managing strings is provided by [`CFString`](/documentation/CoreFoundation/CFString). CFMutableString adds functions to modify the contents of a string.

CFMutableString is “toll-free bridged” with its Cocoa Foundation counterpart, <doc://com.apple.documentation/documentation/Foundation/NSMutableString>. This means that the Core Foundation type is interchangeable in function or method calls with the bridged Foundation object. Therefore, in a method where you see an `NSMutableString *` parameter, you can pass in a `CFMutableStringRef`, and in a function where you see a `CFMutableStringRef` parameter, you can pass in an NSMutableString instance. This also applies to concrete subclasses of NSMutableString. See [Toll-Free Bridged Types](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFDesignConcepts/Articles/tollFreeBridgedTypes.html#//apple_ref/doc/uid/TP40010677) for more information on toll-free bridging.

## Topics

### CFMutableString Miscellaneous Functions

[`CFStringAppend(_:_:)`](/documentation/CoreFoundation/CFStringAppend(_:_:))

Appends the characters of a string to those of a CFMutableString object.

[`CFStringAppendCharacters(_:_:_:)`](/documentation/CoreFoundation/CFStringAppendCharacters(_:_:_:))

Appends a buffer of Unicode characters to the character contents of a CFMutableString object.

[`CFStringAppendCString(_:_:_:)`](/documentation/CoreFoundation/CFStringAppendCString(_:_:_:))

Appends a C string to the character contents of a CFMutableString object.

[`CFStringAppendFormat`](/documentation/CoreFoundation/CFStringAppendFormat)

Appends a formatted string to the character contents of a CFMutableString object.

[`CFStringAppendFormatAndArguments(_:_:_:_:)`](/documentation/CoreFoundation/CFStringAppendFormatAndArguments(_:_:_:_:))

Appends a formatted string to the character contents of a CFMutableString object.

[`CFStringAppendPascalString(_:_:_:)`](/documentation/CoreFoundation/CFStringAppendPascalString(_:_:_:))

Appends a Pascal string to the character contents of a CFMutableString object.

[`CFStringCapitalize(_:_:)`](/documentation/CoreFoundation/CFStringCapitalize(_:_:))

Changes the first character in each word of a string to uppercase (if it is a lowercase alphabetical character).

[`CFStringCreateMutable(_:_:)`](/documentation/CoreFoundation/CFStringCreateMutable(_:_:))

Creates an empty CFMutableString object.

[`CFStringCreateMutableCopy(_:_:_:)`](/documentation/CoreFoundation/CFStringCreateMutableCopy(_:_:_:))

Creates a mutable copy of a string.

[`CFStringCreateMutableWithExternalCharactersNoCopy(_:_:_:_:_:)`](/documentation/CoreFoundation/CFStringCreateMutableWithExternalCharactersNoCopy(_:_:_:_:_:))

Creates a CFMutableString object whose Unicode character buffer is controlled externally.

[`CFStringDelete(_:_:)`](/documentation/CoreFoundation/CFStringDelete(_:_:))

Deletes a range of characters in a string.

[`CFStringFindAndReplace(_:_:_:_:_:)`](/documentation/CoreFoundation/CFStringFindAndReplace(_:_:_:_:_:))

Replaces all occurrences of a substring within a given range.

[`CFStringFold(_:_:_:)`](/documentation/CoreFoundation/CFStringFold(_:_:_:))

Folds a given string into the form specified by optional flags.

[`CFStringInsert(_:_:_:)`](/documentation/CoreFoundation/CFStringInsert(_:_:_:))

Inserts a string at a specified location in the character buffer of a CFMutableString object.

[`CFStringLowercase(_:_:)`](/documentation/CoreFoundation/CFStringLowercase(_:_:))

Changes all uppercase alphabetical characters in a CFMutableString to lowercase.

[`CFStringNormalize(_:_:)`](/documentation/CoreFoundation/CFStringNormalize(_:_:))

Normalizes the string into the specified form as described in Unicode Technical Report #15.

[`CFStringPad(_:_:_:_:)`](/documentation/CoreFoundation/CFStringPad(_:_:_:_:))

Enlarges a string, padding it with specified characters, or truncates the string.

[`CFStringReplace(_:_:_:)`](/documentation/CoreFoundation/CFStringReplace(_:_:_:))

Replaces part of the character contents of a CFMutableString object with another string.

[`CFStringReplaceAll(_:_:)`](/documentation/CoreFoundation/CFStringReplaceAll(_:_:))

Replaces all characters of a CFMutableString object with other characters.

[`CFStringSetExternalCharactersNoCopy(_:_:_:_:)`](/documentation/CoreFoundation/CFStringSetExternalCharactersNoCopy(_:_:_:_:))

Notifies a CFMutableString object that its external backing store of Unicode characters has changed.

[`CFStringTransform(_:_:_:_:)`](/documentation/CoreFoundation/CFStringTransform(_:_:_:_:))

Perform in-place transliteration on a mutable string.

[`CFStringTrim(_:_:)`](/documentation/CoreFoundation/CFStringTrim(_:_:))

Trims a specified substring from the beginning and end of a CFMutableString object.

[`CFStringTrimWhitespace(_:)`](/documentation/CoreFoundation/CFStringTrimWhitespace(_:))

Trims whitespace from the beginning and end of a CFMutableString object.

[`CFStringUppercase(_:_:)`](/documentation/CoreFoundation/CFStringUppercase(_:_:))

Changes all lowercase alphabetical characters in a CFMutableString object to uppercase.

### Constants

[`CFStringNormalizationForm`](/documentation/CoreFoundation/CFStringNormalizationForm)

Unicode normalization forms as described in Unicode Technical Report #15.

[Transform Identifiers for CFStringTransform](/documentation/CoreFoundation/transform-identifiers-for-cfstringtransform)

Constants that identify transforms used with [`CFStringTransform(_:_:_:_:)`](/documentation/CoreFoundation/CFStringTransform(_:_:_:_:)).

## See Also

  [Property List Programming Topics for Core Foundation](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFPropertyLists/CFPropertyLists.html#//apple_ref/doc/uid/10000130i)

  [String Programming Guide for Core Foundation](https://developer.apple.com/library/archive/documentation/CoreFoundation/Conceptual/CFStrings/introCFStrings.html#//apple_ref/doc/uid/10000131i)



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)