Share via


EditPoint.GetLines, méthode

Obtient une chaîne représentant le texte entre deux lignes données.

Espace de noms :  EnvDTE
Assembly :  EnvDTE (dans EnvDTE.dll)

Syntaxe

'Déclaration
Function GetLines ( _
    Start As Integer, _
    ExclusiveEnd As Integer _
) As String
string GetLines(
    int Start,
    int ExclusiveEnd
)
String^ GetLines(
    [InAttribute] int Start, 
    [InAttribute] int ExclusiveEnd
)
abstract GetLines : 
        Start:int * 
        ExclusiveEnd:int -> string
function GetLines(
    Start : int, 
    ExclusiveEnd : int
) : String

Paramètres

  • Start
    Type : Int32

    Optionnel. Numéro de la première ligne dans laquelle inclure le texte.

  • ExclusiveEnd
    Type : Int32

    Requis. Numéro de la dernière ligne dans laquelle inclure le texte.

Valeur de retour

Type : String
Texte entre deux lignes données.

Notes

La chaîne retournée représente le texte entre Start (inclus) et ExclusiveEnd (exclu). Elle comprend des caractères de sauts de ligne (ASCII 13) pour les ruptures de ligne et se termine par un caractère de saut de ligne si la dernière ligne finit sur un caractère de saut de ligne.

Exemples

Sub GetLinesExample()
   Dim objTextDoc As TextDocument
   Dim objEditPt As EditPoint, iCtr As Integer
        
   ' Create a new text file.
   DTE.ItemOperations.NewFile("General\Text File")
        
   ' Get a handle to the new document and create an EditPoint.
   objTextDoc = DTE.ActiveDocument.Object("TextDocument")
   objEditPt = objTextDoc.StartPoint.CreateEditPoint
        
   ' Insert ten lines of text.
   For iCtr = 1 To 10
      objeditpt.Insert("This is a test." & Chr(13))
   Next iCtr
   objEditPt.StartOfDocument()
   msgbox("The results of GetLines: " & Chr(13) & objeditpt.GetLines(1, 6))
End Sub

Sécurité .NET Framework

Voir aussi

Référence

EditPoint Interface

EnvDTE, espace de noms