TextFieldParser.CommentTokens 屬性

定義

定義註解語彙基元 (Token)。 註解語彙基元是一個字串,當置於一行的開頭時,表示該行為註解,剖析器 (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()

屬性值

String[]

字串陣列,其中包含 TextFieldParser 物件的所有註解語彙基元。

例外狀況

註解語彙基元包含空白字元。

範例

本範例會指定 ,TextFieldParserFileReader應該忽略開頭為單引號 ( 的行 ) 。

FileReader.TextFieldType = 
    Microsoft.VisualBasic.FileIO.FieldType.Delimited
FileReader.CommentTokens = New String() {"'"}

備註

這是進階成員;除非您按兩下 [ 所有 ] 索引標籤,否則不會顯示在IntelliSense 中。

忽略長度為零的批註標記。

適用於

另請參閱