ITextSnapshot.GetText Method

Definition

Overloads

GetText(Int32, Int32)

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

GetText()

Gets all the text in the snapshot.

GetText(Span)

Gets text from the snapshot starting at the beginning of the span and having length equal to the length of the span.

GetText(Int32, Int32)

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

C++/CX
public:
 Platform::String ^ GetText(int startIndex, int length);

Parameters

startIndex
Int32

The starting index.

length
Int32

The length of text to get.

Returns

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

Exceptions

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.

Applies to

Visual Studio SDK 2022 a ďalšie verzie
Produkt Verzie
Visual Studio SDK 2015, 2017, 2019, 2022

GetText()

Gets all the text in the snapshot.

C++/CX
public:
 Platform::String ^ GetText();

Returns

A non-null string.

Applies to

Visual Studio SDK 2022 a ďalšie verzie
Produkt Verzie
Visual Studio SDK 2015, 2017, 2019, 2022

GetText(Span)

Gets text from the snapshot starting at the beginning of the span and having length equal to the length of the span.

C++/CX
public:
 Platform::String ^ GetText(Microsoft::VisualStudio::Text::Span span);

Parameters

span
Span

The span to return.

Returns

A non-null string.

Exceptions

The end of the span is greater than Length.

Applies to

Visual Studio SDK 2022 a ďalšie verzie
Produkt Verzie
Visual Studio SDK 2015, 2017, 2019, 2022