-
-
Save lgolubyev/599fb8351b32f2b7e8ec7c666297c548 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public IEnumerable<string> ReadFileLineByLine(string fileName) | |
{ | |
if (string.IsNullOrEmpty(fileName)) | |
{ | |
throw new ArgumentNullException(nameof(fileName)); | |
} | |
return ReadFileLineByLineImpl(); | |
IEnumerable<string> ReadFileLineByLineImpl() | |
{ | |
foreach (var line in File.ReadAllLines(fileName)) | |
{ | |
yield return line; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment