Partager via


EditPoint2.GetLines, méthode (Int32, Int32)

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

Espace de noms :  EnvDTE80
Assembly :  EnvDTE80 (dans EnvDTE80.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 : System.Int32
    Facultatif.Numéro de la dernière ligne dans laquelle inclure le texte.
  • ExclusiveEnd
    Type : System.Int32
    Obligatoire.Numéro de la première ligne dans laquelle inclure le texte.

Valeur de retour

Type : System.String
Texte entre deux lignes données.

Implémentations

EditPoint.GetLines(Int32, Int32)

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

EditPoint2 Interface

GetLines, surcharge

EnvDTE80, espace de noms