Feb 20
It’s easy to read a string one line at a time. Here is a console program that demonstrates how:
using System;
using System.IO;
namespace CSharp411
{
class Program
{
static void Main( string[] args )
{
string text = "Hello\nGoodbye, world\n\nDon't have a cow";
using (StringReader reader = new StringReader( text ))
{
string line;
while ((line = reader.ReadLine()) != null)
{
Console.WriteLine( line );
}
}
Console.ReadLine();
}
}
}
Popularity: 24% [?]
Related posts:


Thanks very much, this was helpfull.