<!--
{
  "availability" : [
    "iOS: 16.0.0 -",
    "iPadOS: 16.0.0 -",
    "macCatalyst: -",
    "visionOS: -"
  ],
  "documentType" : "symbol",
  "framework" : "UIKit",
  "identifier" : "/documentation/UIKit/UITextSearching-3wkjv/replaceAll(queryString:options:withText:)",
  "metadataVersion" : "0.1.0",
  "role" : "Instance Method",
  "symbol" : {
    "kind" : "Instance Method",
    "modules" : [
      "UIKit"
    ],
    "preciseIdentifier" : "s:5UIKit15UITextSearchingP10replaceAll11queryString7options8withTextySS_So0B13SearchOptionsCSStF"
  },
  "title" : "replaceAll(queryString:options:withText:)"
}
-->

# replaceAll(queryString:options:withText:)

Informs the searchable object to replace all matching text across all searchable documents.

```
func replaceAll(queryString: String, options: UITextSearchOptions, withText: String)
```

## Parameters

`queryString`

The string to search for and replace.

`options`

The configurable options to use for matching words and comparing strings.

`withText`

The string to replace the text with.

## Discussion

When [`supportsTextReplacement`](/documentation/UIKit/UITextSearching-3wkjv/supportsTextReplacement) returns `YES,` the system calls this method during a find session to request the replacement of all text matching the query string.

---

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)