Rediger

Del via


TextFieldParser.CommentTokens Property

Definition

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.

public:
 property cli::array <System::String ^> ^ CommentTokens { cli::array <System::String ^> ^ get(); void set(cli::array <System::String ^> ^ value); };
public string[]? CommentTokens { get; set; }
public string[] CommentTokens { get; set; }
member this.CommentTokens : string[] with get, set
Public Property CommentTokens As String()

Property Value

String[]

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

Exceptions

A comment token includes white space.

Examples

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

Remarks

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

Zero-length comment tokens are ignored.

Applies to

See also