Freigeben über


Source.UncommentLines(TextSpan, String) Method

Definition

Removes line comment characters from the beginning of each line in the given span.

public:
 virtual Microsoft::VisualStudio::TextManager::Interop::TextSpan UncommentLines(Microsoft::VisualStudio::TextManager::Interop::TextSpan span, System::String ^ lineComment);
public:
 virtual Microsoft::VisualStudio::TextManager::Interop::TextSpan UncommentLines(Microsoft::VisualStudio::TextManager::Interop::TextSpan span, Platform::String ^ lineComment);
 virtual Microsoft::VisualStudio::TextManager::Interop::TextSpan UncommentLines(Microsoft::VisualStudio::TextManager::Interop::TextSpan span, std::wstring const & lineComment);
public virtual Microsoft.VisualStudio.TextManager.Interop.TextSpan UncommentLines (Microsoft.VisualStudio.TextManager.Interop.TextSpan span, string lineComment);
abstract member UncommentLines : Microsoft.VisualStudio.TextManager.Interop.TextSpan * string -> Microsoft.VisualStudio.TextManager.Interop.TextSpan
override this.UncommentLines : Microsoft.VisualStudio.TextManager.Interop.TextSpan * string -> Microsoft.VisualStudio.TextManager.Interop.TextSpan
Public Overridable Function UncommentLines (span As TextSpan, lineComment As String) As TextSpan

Parameters

span
TextSpan

A TextSpan object describing the range of lines to examine.

lineComment
String

The characters that start a line comment.

Returns

A new TextSpan object describing the span after the line comment characters have been removed.

Remarks

Remove the leading line comment characters from the beginning of each line in the span.

The base method examines each line in the span and removes the first set of line comment characters from the beginning of the line, skipping any leading whitespace in the search. If the span's extent is zero, only the line specified as the starting line is examined.

This method is typically called from the UncommentSpan method.

Applies to