Skip to content

Instantly share code, notes, and snippets.

@jfoshee
Created June 3, 2024 14:20
Show Gist options
  • Select an option

  • Save jfoshee/5ff2b4be6903a7e123f68d286f10aefa to your computer and use it in GitHub Desktop.

Select an option

Save jfoshee/5ff2b4be6903a7e123f68d286f10aefa to your computer and use it in GitHub Desktop.

Revisions

  1. jfoshee created this gist Jun 3, 2024.
    11 changes: 11 additions & 0 deletions StreamReaderExtensions.cs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,11 @@
    public static class StreamReaderExtensions
    {
    public static IEnumerable<string> ReadLines(this StreamReader reader)
    {
    string? line;
    while ((line = reader.ReadLine()) is not null)
    {
    yield return line;
    }
    }
    }