Feb 20
It’s easy to read a string one line at a time. Here is a console program that demonstrates how:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | 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(); } } } |
Thanks very much, this was helpfull.
Thanks A lot
very good for a quick ref
Thank you Sir,
It was helpful for me. Great and Simple coding.
Thank you so much