다음을 통해 공유


TextSelection.DeleteWhitespace(vsWhitespaceOptions) Method

Definition

Deletes the empty characters (white space) horizontally or vertically around the current location in the text buffer.

void DeleteWhitespace(EnvDTE::vsWhitespaceOptions Direction = EnvDTE.vsWhitespaceOptions.vsWhitespaceOptionsHorizontal);
[System.Runtime.InteropServices.DispId(25)]
public void DeleteWhitespace (EnvDTE.vsWhitespaceOptions Direction = EnvDTE.vsWhitespaceOptions.vsWhitespaceOptionsHorizontal);
[<System.Runtime.InteropServices.DispId(25)>]
abstract member DeleteWhitespace : EnvDTE.vsWhitespaceOptions -> unit
Public Sub DeleteWhitespace (Optional Direction As vsWhitespaceOptions = EnvDTE.vsWhitespaceOptions.vsWhitespaceOptionsHorizontal)

Parameters

Direction
vsWhitespaceOptions

Optional. A vsWhitespaceOptions constant that determines how and where to remove empty spaces.

Attributes

Remarks

DeleteWhitespace removes white (empty) space around the TextSelection without first copying the text to the clipboard. If Direction is vsWhitespaceOptionsHorizontal, then DeleteWhitespace deletes spaces and tab characters on both sides of the edit point to the beginning and end of the edit point's line, or until a non-white-space character is encountered. If Direction is vsWhitespaceOptionsVertical, then DeleteWhitespace deletes blank lines on both sides of the edit point to the beginning and end of the document, or until a nonblank line is encountered. If Direction is vsWhitespaceOptionsVertical, and the current line is not blank, then this method does nothing.

Applies to