static void Main(string[] args) { Console.WriteLine("This is task 2"); LoadBook loadBook = new LoadBook(); FindAndReplaceManager.FindNext(loadBook); Console.ReadKey(); }
public static void FindNext(LoadBook book) { var lVar = book.StreamReaderBook; while (!lVar.EndOfStream) { string line = lVar.ReadLine(); if (line.StartsWith(partOfText)) { Console.WriteLine(line); foreach (var lines in lVar.ReadToEnd()) { Console.Write(lines); } break; } } book.StreamReaderBook.Close(); }