Dela via


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()

Property Value

String ().

Exceptions

The following condition may produce an exception:

Remarks

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

Zero-length comment tokens are ignored.

Example

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() {"'"}

Requirements

Namespace:Microsoft.VisualBasic.FileIO

Class:TextFieldParser

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

Permissions

No permissions are required.

See Also

Tasks

How to: Read From Comma-Delimited Text Files in Visual Basic

How to: Read From Fixed-width Text Files in Visual Basic

How to: Read From Text Files with Multiple Formats in Visual Basic

Reference

TextFieldParser Object

TextFieldParser.CommentTokens