---
title: "performSingleReplacement(query:replacementString:options:)"
framework: uikit
role: symbol
role_heading: Instance Method
path: "uikit/uifindsession/performsinglereplacement(query:replacementstring:options:)"
---

# performSingleReplacement(query:replacementString:options:)

Replaces a single instance of the query string with the replacement string you provide.

## Declaration

```swift
func performSingleReplacement(query searchQuery: String, replacementString: String, options: UITextSearchOptions?)
```

## Parameters

- `searchQuery`: The string to search for and replace, the user provides through the search text field of the system find panel.
- `replacementString`: The replacement string, the user provides through the replace text field of the system find panel.
- `options`: The object containing all the configurable options for the search.

## Discussion

Discussion The system calls this method when the user initiates the replacement the text for a single match of a string in your app’s text content with the replacement string.

## See Also

### Managing session interactions

- [performSearch(query:options:)](uikit/uifindsession/performsearch(query:options:).md)
- [replaceAll(searchQuery:replacementString:options:)](uikit/uifindsession/replaceall(searchquery:replacementstring:options:).md)
- [highlightNextResult(in:)](uikit/uifindsession/highlightnextresult(in:).md)
- [invalidateFoundResults()](uikit/uifindsession/invalidatefoundresults().md)
