Freigeben über


EditPoint.GetLines Method

Gets a string representing the text between two given lines.

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

Syntax

'Declaration
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

Parameters

  • Start
    Type: System.Int32

    Optional. The first line number to include the text.

  • ExclusiveEnd
    Type: System.Int32

    Required. The last line number to include the text.

Return Value

Type: System.String
The text between two given lines.

Remarks

The returned string represents the text between Start (inclusive) and ExclusiveEnd (exclusive). The string includes newline characters (ACSII character 13) for line boundaries, and ends with a newline character if the last line ended in a newline character.

Examples

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

.NET Framework Security

See Also

Reference

EditPoint Interface

EnvDTE Namespace