public CsvWriter(
string filePath,
IEnumerable<string?> columnNames,
bool caseSensitive = false,
char delimiter = ',',
Encoding? textEncoding = null
)
Public Sub New (
filePath As String,
columnNames As IEnumerable(Of String),
Optional caseSensitive As Boolean = false,
Optional delimiter As Char = ","C,
Optional textEncoding As Encoding = Nothing
)
public:
CsvWriter(
String^ filePath,
IEnumerable<String^>^ columnNames,
bool caseSensitive = false,
wchar_t delimiter = L',',
Encoding^ textEncoding = nullptr
)
new :
filePath : string *
columnNames : IEnumerable<string> *
?caseSensitive : bool *
?delimiter : char *
?textEncoding : Encoding
(* Defaults:
let _caseSensitive = defaultArg caseSensitive false
let _delimiter = defaultArg delimiter ','
let _textEncoding = defaultArg textEncoding null
*)
-> 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 file and their index in CsvRecord. The CsvRecord instance, which the Record property of the newly initialized CsvWriter gets, can be accessed with this column names.
ArgumentNullException | filePath is null. |
ArgumentException | filePath is not a valid file path - or - a column name in columnNames occurs twice. With caseSensitive can be chosen whether the comparison is case-sensitive or not. |
ArgumentOutOfRangeException | delimiter is either the double quotes " or a line break character ('\r' or '\n'). |
IOException | I/O error. |