how to save a dictionary as a csv file in c#

52

how to save a dictionary as a csv file in c# -

String csv = String.Join(
    Environment.NewLine,
    data.Select(d => $"{d.Key};{d.Value};")
);
System.IO.File.WriteAllText(pathToCsv, csv);

Comments

Submit
0 Comments