.NET Framework 4.5.2+
.NET Framework 4.5.2+
.NET Standard 2.0+

SubDocument.ReplaceAll(String, String, SearchOptions) Method

Finds all occurrences of the search string in the current document, and replaces them with the replacement string.

Namespace: DevExpress.XtraRichEdit.API.Native

Assembly: DevExpress.RichEdit.v21.1.Core.dll


int ReplaceAll(
    string textToFind,
    string replaceWith,
    SearchOptions options


Name Type Description
textToFind String

A string specifying the search text.

replaceWith String

A string specifying the replacement text.

options SearchOptions

A SearchOptions enumeration specifying search options.


Type Description

The number of replacements made.


The code sample below shows how to replace “Application Programming Interface” to “API”:

int replacements = wordProcessor.Document.ReplaceAll("Application Programming Interface", "API", SearchOptions.WholeWord);
Console.WriteLine(String.Format("The {0} replacements were made", replacements));
See Also