7
Reply

Why got empty lines?

Dave

Dave

Jan 5 2014 2:14 PM
956
Hi,
In Application.StartupPath + @"\Test.txt" got
11111
2222
3333
Read them and print out:
string ss = System.IO.File.ReadAllText(Application.StartupPath + @"\Test.txt");
string[] items = ss.Split('\n');
foreach(string item in items)
Console.WriteLine(item);
Why got empty lines as follows:
11111
(empty line here)
2222
(empty line here)
3333

Answers (7)