IEditorOperations::ReplaceAllMatches Method (String^, String^, Boolean, Boolean, Boolean)

 

Replaces all matching occurrences of the given string.

Namespace:   Microsoft.VisualStudio.Text.Operations
Assembly:  Microsoft.VisualStudio.Text.UI (in Microsoft.VisualStudio.Text.UI.dll)

int ReplaceAllMatches(
	String^ searchText,
	String^ replaceText,
	bool matchCase,
	bool matchWholeWord,
	bool useRegularExpressions
)

Parameters

searchText
Type: System::String^

The text to match.

replaceText
Type: System::String^

The replacement text.

matchCase
Type: System::Boolean

true if the search should match case, otherwise false.

matchWholeWord
Type: System::Boolean

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

useRegularExpressions
Type: System::Boolean

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

Return Value

Type: System::Int32

The number of matches found.

Exception Condition
ArgumentNullException

searchText is null.

ArgumentException

useRegularExpressions is true and searchText is an invalid regular expression.

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

Return to top
Show: