ITextBuffer::Delete Method (Span)

 

Deletes a sequence of characters from the buffer.

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

ITextSnapshot^ Delete(
	Span deleteSpan
)

Parameters

deleteSpan
Type: Microsoft.VisualStudio.Text::Span

The span of characters to delete.

Exception Condition
InvalidOperationException

A ITextEdit is currently active.

ArgumentOutOfRangeException

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

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

Return to top
Show: