ITextBuffer.Delete(Span) Method

Definition

Deletes a sequence of characters from the buffer.

C++/CX
public:
 Microsoft::VisualStudio::Text::ITextSnapshot ^ Delete(Microsoft::VisualStudio::Text::Span deleteSpan);

Parameters

deleteSpan
Span

The span of characters to delete.

Returns

The ITextSnapshot.

Exceptions

deleteSpan.End is greater than the length of the buffer.

A TextEdit is currently active, or CheckEditAccess() would return false.

Remarks

This is a shortcut for creating a new ITextEdit object, using it to delete the text, and then applying it. If the deletion fails on account of a read-only region, the snapshot returned will be the same as the current snapshot of the buffer before the attempted deletion.

Applies to

Produkt Verzie
Visual Studio SDK 2015, 2017, 2019, 2022