public static void Save(
IEnumerable<IEnumerable<Object?>?> data,
string filePath,
char delimiter = ',',
IFormatProvider? formatProvider = null,
Encoding? textEncoding = null,
string? format = null
)
Public Shared Sub Save (
data As IEnumerable(Of IEnumerable(Of Object)),
filePath As String,
Optional delimiter As Char = ","C,
Optional formatProvider As IFormatProvider = Nothing,
Optional textEncoding As Encoding = Nothing,
Optional format As String = Nothing
)
public:
static void Save(
IEnumerable<IEnumerable<Object^>^>^ data,
String^ filePath,
wchar_t delimiter = L',',
IFormatProvider^ formatProvider = nullptr,
Encoding^ textEncoding = nullptr,
String^ format = nullptr
)
static member Save :
data : IEnumerable<IEnumerable<Object>> *
filePath : string *
?delimiter : char *
?formatProvider : IFormatProvider *
?textEncoding : Encoding *
?format : string
(* Defaults:
let _delimiter = defaultArg delimiter ','
let _formatProvider = defaultArg formatProvider null
let _textEncoding = defaultArg textEncoding null
let _format = defaultArg format null
*)
-> unit
The provider to use to format the value.
- or -
A null reference for InvariantCulture.
A format String to use for all items that implement IFormattable.
- or -
A null reference to use the default format for each item.
Creates a new CSV file. If the target file already exists, it is truncated and overwritten.
For serialization ToString(String, IFormatProvider) is used if the item implements IFormattable, otherwise ToString.
When exchanging CSV data with Excel, the appropriate arguments can be determined with GetExcelArguments.
ArgumentNullException | data or filePath is null. |
ArgumentException | filePath is not a valid file path. |
ArgumentOutOfRangeException | delimiter is either the double quotes " or a line break character ('\r' or '\n'). |
IOException | I/O error. |