Iterate over each line of a string in C# Apr 17th, 2012 For future reference. Easy way to go through each line of a string. string iteration1 2 3 4 5 6 7 8 using (StringReader reader = new StringReader(txt)) { string line; while ((line = reader.ReadLine()) != null) { Console.Log("do anything with the line); } }