<!--
{
  "availability" : [
    "iOS: -",
    "iPadOS: -",
    "macCatalyst: -",
    "macOS: -",
    "tvOS: -",
    "visionOS: -",
    "watchOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreFoundation",
  "identifier" : "/documentation/CoreFoundation/CFStringReplaceAll(_:_:)",
  "metadataVersion" : "0.1.0",
  "role" : "Function",
  "symbol" : {
    "kind" : "Function",
    "modules" : [
      "Core Foundation"
    ],
    "preciseIdentifier" : "c:@F@CFStringReplaceAll"
  },
  "title" : "CFStringReplaceAll(_:_:)"
}
-->

# CFStringReplaceAll(_:_:)

Replaces all characters of a CFMutableString object with other characters.

```
func CFStringReplaceAll(_ theString: CFMutableString!, _ replacement: CFString!)
```

## Parameters

`theString`

The string to modify. If this value is not a CFMutableString object, an assertion is raised.

`replacement`

The replacement string to put into `theString`.

## Discussion

The character buffer of `theString` is resized according to the length of the new characters.

---

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)