Udostępnij za pośrednictwem


IEditorOperations.ReplaceAllMatches Method

Definition

Replaces all matching occurrences of the given string.

public:
 int ReplaceAllMatches(System::String ^ searchText, System::String ^ replaceText, bool matchCase, bool matchWholeWord, bool useRegularExpressions);
public:
 int ReplaceAllMatches(Platform::String ^ searchText, Platform::String ^ replaceText, bool matchCase, bool matchWholeWord, bool useRegularExpressions);
int ReplaceAllMatches(std::wstring const & searchText, std::wstring const & replaceText, bool matchCase, bool matchWholeWord, bool useRegularExpressions);
public int ReplaceAllMatches (string searchText, string replaceText, bool matchCase, bool matchWholeWord, bool useRegularExpressions);
abstract member ReplaceAllMatches : string * string * bool * bool * bool -> int
Public Function ReplaceAllMatches (searchText As String, replaceText As String, matchCase As Boolean, matchWholeWord As Boolean, useRegularExpressions As Boolean) As Integer

Parameters

searchText
String

The text to match.

replaceText
String

The replacement text.

matchCase
Boolean

true if the search should match case, otherwise false.

matchWholeWord
Boolean

true if the search should match whole words, otherwise false.

useRegularExpressions
Boolean

true if the search should use regular expressions, otherwise false.

Returns

true if the edit succeeded, otherwise false.

Exceptions

searchText is null.

if useRegularExpressions is true and searchText is an invalid regular expression.

Remarks

If any of the matches found is read only, none of the matches will be replaced.

Applies to