Delimiters Property (TextFieldParser Object)
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

TextFieldParser.Delimiters Property 

Defines the delimiters for a text file.


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

String ().

The following condition may result in an exception:

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

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.

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

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

Namespace: Microsoft.VisualBasic.FileIO

Class: TextFieldParser

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

No permissions are required.

Show:
© 2016 Microsoft