Created
December 11, 2013 19:33
-
-
Save ronnieoverby/7916886 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
internal static IEnumerable<string> ReadLines(this string s) | |
{ | |
string line; | |
using (var sr = new StringReader(s)) | |
while ((line = sr.ReadLine()) != null) | |
yield return line; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Thanks very much for this - saved me a bunch of time as newbie C# guy who got the right approach but not how to write it.