Compartilhar via


ITextSearchService2.FindAllForReplace Method

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)

Syntax

'Declaration
Function FindAllForReplace ( _
    searchRange As SnapshotSpan, _
    searchPattern As String, _
    replacePattern As String, _
    options As FindOptions _
) As IEnumerable(Of Tuple(Of SnapshotSpan, String))
IEnumerable<Tuple<SnapshotSpan, string>> FindAllForReplace(
    SnapshotSpan searchRange,
    string searchPattern,
    string replacePattern,
    FindOptions options
)
IEnumerable<Tuple<SnapshotSpan, String^>^>^ FindAllForReplace(
    SnapshotSpan searchRange, 
    String^ searchPattern, 
    String^ replacePattern, 
    FindOptions options
)
abstract FindAllForReplace : 
        searchRange:SnapshotSpan * 
        searchPattern:string * 
        replacePattern:string * 
        options:FindOptions -> IEnumerable<Tuple<SnapshotSpan, string>> 
function FindAllForReplace(
    searchRange : SnapshotSpan, 
    searchPattern : String, 
    replacePattern : String, 
    options : FindOptions
) : IEnumerable<Tuple<SnapshotSpan, String>>

Parameters

  • searchPattern
    Type: String

    The pattern to search for.

  • replacePattern
    Type: String

    The replace pattern to use for the operation.

Return Value

Type: IEnumerable<Tuple<SnapshotSpan, String>>
An T[:System.Collections.Generic.IEnumerable`1] containing all matches found and their corresponding replacement values.

Remarks

The returned IEnumerable 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.

.NET Framework Security

See Also

Reference

ITextSearchService2 Interface

Microsoft.VisualStudio.Text.Operations Namespace