using System; using System.Collections.Generic; using System.IO; using System.Text; namespace Lab4.ChainedWords { static class InOut { /// /// Read a file line-by-line using an enumarable /// /// Target file /// Enumerable public static IEnumerable ReadByLines(string filename) { string line; using (StreamReader reader = new StreamReader(filename)) { while ((line = reader.ReadLine()) != null) { yield return line; } } } } }