Partager via


IEditorOperations.ReplaceAllMatches, méthode

Remplace toutes les occurrences correspondantes de la chaîne spécifiée.

Espace de noms :  Microsoft.VisualStudio.Text.Operations
Assembly :  Microsoft.VisualStudio.Text.UI (dans Microsoft.VisualStudio.Text.UI.dll)

Syntaxe

'Déclaration
Function ReplaceAllMatches ( _
    searchText As String, _
    replaceText As String, _
    matchCase As Boolean, _
    matchWholeWord As Boolean, _
    useRegularExpressions As Boolean _
) As Integer
int ReplaceAllMatches(
    string searchText,
    string replaceText,
    bool matchCase,
    bool matchWholeWord,
    bool useRegularExpressions
)
int ReplaceAllMatches(
    String^ searchText, 
    String^ replaceText, 
    bool matchCase, 
    bool matchWholeWord, 
    bool useRegularExpressions
)
abstract ReplaceAllMatches : 
        searchText:string * 
        replaceText:string * 
        matchCase:bool * 
        matchWholeWord:bool * 
        useRegularExpressions:bool -> int
function ReplaceAllMatches(
    searchText : String, 
    replaceText : String, 
    matchCase : boolean, 
    matchWholeWord : boolean, 
    useRegularExpressions : boolean
) : int

Paramètres

  • searchText
    Type : String

    Le texte à rechercher.

  • replaceText
    Type : String

    Texte de remplacement.

  • matchCase
    Type : Boolean

    true si la recherche doit respecter la casse ; sinon, false.

  • matchWholeWord
    Type : Boolean

    true si la recherche doit prendre en compte les mots entiers, sinon false.

  • useRegularExpressions
    Type : Boolean

    true si la recherche doit utiliser des expressions régulières ; sinon, false.

Valeur de retour

Type : Int32
Nombre de correspondances trouvées.

Exceptions

Exception Condition
ArgumentNullException

searchText a la valeur nullune référence null (Nothing en Visual Basic).

ArgumentException

useRegularExpressions est true et searchText est une expression régulière valide.

Notes

Si les correspondances l'une des recherchées est en lecture seule, aucune des correspondances ne sera remplacée.

Sécurité .NET Framework

Voir aussi

Référence

IEditorOperations Interface

Microsoft.VisualStudio.Text.Operations, espace de noms