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.

' Usage
Dim value As String() = TextFieldParserObject.CommentTokens
' Declaration
Public Property CommentTokens As String()

String ().

The following condition may produce an exception:

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 = Microsoft.VisualBasic.FileIO.FieldType.Delimited
FileReader.CommentTokens = New String() {"'"}

Namespace: Microsoft.VisualBasic.FileIO

Class: TextFieldParser

Assembly: Visual Basic Runtime Library (in Microsoft.VisualBasic.dll)

No permissions are required.

Community Additions