Skip to content

Instantly share code, notes, and snippets.

@jfoshee
Created June 3, 2024 14:20
Show Gist options
  • Save jfoshee/5ff2b4be6903a7e123f68d286f10aefa to your computer and use it in GitHub Desktop.
Save jfoshee/5ff2b4be6903a7e123f68d286f10aefa to your computer and use it in GitHub Desktop.
public static class StreamReaderExtensions
{
public static IEnumerable<string> ReadLines(this StreamReader reader)
{
string? line;
while ((line = reader.ReadLine()) is not null)
{
yield return line;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment