ITextSnapshot::GetText Method (Int32, Int32)

 

Gets text from the snapshot starting at startIndex and having a length equal to length.

Namespace:   Microsoft.VisualStudio.Text
Assembly:  Microsoft.VisualStudio.Text.Data (in Microsoft.VisualStudio.Text.Data.dll)

String^ GetText(
	int startIndex,
	int length
)

Parameters

startIndex
Type: System::Int32

The starting index.

length
Type: System::Int32

The length of text to get.

Return Value

Type: System::String^

The string of length length starting at startIndex in the underlying ITextBuffer.

Exception Condition
ArgumentOutOfRangeException

startIndex is less than zero or greater than the length of the snapshot, or length is less than zero, or startIndex plus length is greater than the length of the snapshot.

Return to top
Show: