Answers for "write list of string to file c#"

C#
0

List string to file C#

string[] lines = { "First line", "Second line", "Third line" };
System.IO.File.WriteAllLines(@"C:UsersPublicTestFolderWriteLines.txt", lines);
lines = { "Fourth line", "Fith line" };
System.IO.File.AppendAllLines(@"C:UsersPublicTestFolderWriteLines.txt", lines);
Posted by: Guest on August-14-2020

C# Answers by Framework

Browse Popular Code Answers by Language