public static CsvWriter OpenWrite(
TextWriter writer,
IReadOnlyCollection<string?> columnNames,
char delimiter = ','
)
Public Shared Function OpenWrite (
writer As TextWriter,
columnNames As IReadOnlyCollection(Of String),
Optional delimiter As Char = ","C
) As CsvWriter
public:
static CsvWriter^ OpenWrite(
TextWriter^ writer,
IReadOnlyCollection<String^>^ columnNames,
wchar_t delimiter = L','
)
static member OpenWrite :
writer : TextWriter *
columnNames : IReadOnlyCollection<string> *
?delimiter : char
(* Defaults:
let _delimiter = defaultArg delimiter ','
*)
-> CsvWriter
A collection of column names for the header to be written.
The collection determines the order in which the columns appear in the CSV and their index in CsvRecord. The Record of the CsvWriter instance, which the method returns, can be accessed with this column names.
The collection will be copied. If the collection contains null values, empty strings or white space, these are replaced by automatically generated column names. Column names cannot appear twice. By default the comparison is case-sensitive but it will be reset to a case-insensitive comparison if the column names are also unique when treated case-insensitive.
ArgumentNullException | writer or columnNames is null. |
ArgumentException | A column name in columnNames occurs twice. |
ArgumentOutOfRangeException | delimiter is either the double quotes " or a line break character ('\r' or '\n'). |