TextFieldParser.SetDelimiters(String[]) Method
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the delimiters for the reader to the specified values, and sets the field type to Delimited
.
public:
void SetDelimiters(... cli::array <System::String ^> ^ delimiters);
public void SetDelimiters (params string[]? delimiters);
public void SetDelimiters (params string[] delimiters);
member this.SetDelimiters : string[] -> unit
Public Sub SetDelimiters (ParamArray delimiters As String())
- delimiters
- String[]
Array of type String
.
A delimiter is zero-length.
This example opens a text field parser and defines the delimiter as vbTab
.
Using FileReader As New Microsoft.VisualBasic.FileIO.
TextFieldParser("C:\logs\test.log")
FileReader.SetDelimiters(vbTab)
End Using
Replace the path C:\logs\test.log
with the path and name of the file you wish to parse.
The existing contents of the Delimiters
property are cleared when this method is set.
This method provides a way to set delimiters without creating an array.
The following table lists an example of a task involving the SetDelimiters
method.
To | See |
---|---|
Parse a text file | Parsing Text Files with the TextFieldParser Object |
Product | Versies |
---|---|
.NET | Core 3.0, Core 3.1, 5, 6, 7, 8, 9 |
.NET Framework | 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET-feedback
.NET is een open source project. Selecteer een koppeling om feedback te geven: