Source.ScanToNonWhitespaceChar Method

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

Namespace:  Microsoft.VisualStudio.Package
Assemblies:   Microsoft.VisualStudio.Package.LanguageService.10.0 (in Microsoft.VisualStudio.Package.LanguageService.10.0.dll)
  Microsoft.VisualStudio.Package.LanguageService (in Microsoft.VisualStudio.Package.LanguageService.dll)
  Microsoft.VisualStudio.Package.LanguageService.11.0 (in Microsoft.VisualStudio.Package.LanguageService.11.0.dll)
  Microsoft.VisualStudio.Package.LanguageService.9.0 (in Microsoft.VisualStudio.Package.LanguageService.9.0.dll)

Syntax

'Declaration
Public Function ScanToNonWhitespaceChar ( _
    line As Integer _
) As Integer
public int ScanToNonWhitespaceChar(
    int line
)
public:
int ScanToNonWhitespaceChar(
    int line
)
member ScanToNonWhitespaceChar : 
        line:int -> int
public function ScanToNonWhitespaceChar(
    line : int
) : int

Parameters

Return Value

Type: System.Int32
A character offset to the first non-whitespace character.

Remarks

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.

.NET Framework Security

See Also

Reference

Source Class

Microsoft.VisualStudio.Package Namespace