Source::ScanToNonWhitespaceChar Method (Int32)

 

Returns the offset of the first non-whitespace character on the given line.

Namespace:   Microsoft.VisualStudio.Package
Assembly:  Microsoft.VisualStudio.Package.LanguageService.14.0 (in Microsoft.VisualStudio.Package.LanguageService.14.0.dll)

public:
int ScanToNonWhitespaceChar(
	int line
)

Parameters

line
Type: System::Int32

The line number to examine.

Return Value

Type: System::Int32

A character offset to the first non-whitespace character.

This helper method is used primarily by the comment/uncomment methods to skip any leading whitespace on a line. This method can throw an exception if the line number is out of bounds.

If the line is empty or contains only whitespace, the offset returned equals the length of the line.

Return to top
Show: