ITextSearchService2::FindAllForReplace Method (SnapshotSpan, String^, String^, FindOptions)

 

Searches for all occurrences of the searchPattern and calculates all the corresponding replacement results for every match according to the replacePattern.

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

IEnumerable<Tuple<SnapshotSpan, String^>^>^ FindAllForReplace(
	SnapshotSpan searchRange,
	String^ searchPattern,
	String^ replacePattern,
	FindOptions options
)

Parameters

searchRange
Type: Microsoft.VisualStudio.Text::SnapshotSpan

The range of text to search in.

searchPattern
Type: System::String^

The pattern to search for.

replacePattern
Type: System::String^

The replace pattern to use for the operation.

options
Type: Microsoft.VisualStudio.Text.Operations::FindOptions

The options to use while performing the search operation.

Return Value

Type: System.Collections.Generic::IEnumerable<Tuple<SnapshotSpanString^>^>^

An T:System.Collections.Generic.IEnumerable`1 containing all matches found and their corresponding replacement values.

The returned IEnumerable<T> will contain a collection of tuples indicating all the matches. Each Tuple will contain a SnapshotSpan referencing the location of the match and a String containing the calculated replacement text for the match.

Return to top
Show: