CsvParse Method

Parses a CSV-String to make its content accessible.

Definition

Namespace: FolkerKinzel.CsvTools
Assembly: FolkerKinzel.CsvTools (in FolkerKinzel.CsvTools.dll) Version: 2.0.2+e1e095fbd3614788c84dad3204b1e88c20f89802
C#
public static CsvRecord[] Parse(
	string csv,
	char delimiter = ',',
	bool isHeaderPresent = true,
	CsvOpts options = CsvOpts.Default
)

Parameters

csv  String
The CSV-String to parse.
delimiter  Char  (Optional)
The field separator character.
isHeaderPresent  Boolean  (Optional)
true, to interpret the first line as a header, otherwise false.
options  CsvOpts  (Optional)
Parsing options. (The flag DisableCaching will be ignored.)

Return Value

CsvRecord
An array of CsvRecord objects containing the parsed data.

Remarks

Exceptions

ArgumentNullExceptioncsv is null.
CsvFormatExceptionInvalid CSV. The interpretation depends on options.

See Also