TextFieldParser.CommentTokens Property


Defines comment tokens. A comment token is a string that, when placed at the beginning of a line, indicates that the line is a comment and should be ignored by the parser.

Namespace:   Microsoft.VisualBasic.FileIO
Assembly:  Microsoft.VisualBasic (in Microsoft.VisualBasic.dll)

public string[] CommentTokens { get; set; }

Property Value

Type: System.String[]

A string array that contains all of the comment tokens for the TextFieldParser object.

Exception Condition

A comment token includes white space.

This is an advanced member; it does not show in IntelliSense unless you click the All tab.

Zero-length comment tokens are ignored.

This example specifies that for the TextFieldParser, FileReader lines beginning with a single quotation mark (') should be ignored.

FileReader.TextFieldType = 
FileReader.CommentTokens = New String() {"'"}

.NET Framework
Available since 2.0
Return to top