Instead of File.ReadAllText() better use
File.ReadLines(@"C:\file.txt");
It returns IEnumerable
(yielded) so you will not have to read the whole file if your string is found before the last line of the text file is reached
Instead of File.ReadAllText() better use
File.ReadLines(@"C:\file.txt");
It returns IEnumerable
(yielded) so you will not have to read the whole file if your string is found before the last line of the text file is reached