TextFieldParser.Delimiters Property

Defines the delimiters for a text file.

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

Property Value

String ().

Exceptions

The following condition may result in an exception:

  • An attempt to use a newline character, an empty string, or Nothing as a delimiter (ArgumentException).

Remarks

This property is meaningful only if TextFieldType = FieldType.Delimited.

Defining the delimiters for a text file can also be accomplished with the SetDelimiters method. For more information, see TextFieldParser.SetDelimiters Method.

Tasks

The following table lists an example of a task involving the Delimiters property.

To

See

Read from a delimited text file

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

Example

This example specifies that the delimiter for the TextFieldParser object, FileReader, is a comma (,).

FileReader.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited
FileReader.Delimiters = 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

Concepts

Parsing Text Files with the TextFieldParser Object

Reference

TextFieldParser Object

TextFieldParser.Delimiters

TextFieldParser.SetDelimiters Method