Dave

Dave

  • NA
  • 48
  • 24k

Why got empty lines?

Jan 5 2014 2:14 PM
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)