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 = "HellonGoodbye, worldnnDon't have a cow"; 
            using (StringReader reader = new StringReader( text )) 
            { 
                string line; 
                while ((line = reader.ReadLine()) != null) 
                { 
                    Console.WriteLine( line ); 
                } 
            } 
            Console.ReadLine(); 
        } 
    } 
}
Share and Enjoy:
  • Digg
  • Twitter
  • Facebook
  • Reddit
  • StumbleUpon
  • LinkedIn
  • Google Bookmarks
  • Slashdot