Add day 2
This commit is contained in:
17
StringExtensions.cs
Normal file
17
StringExtensions.cs
Normal file
@@ -0,0 +1,17 @@
|
||||
namespace AdventOfCode;
|
||||
|
||||
public static class StringExtensions
|
||||
{
|
||||
public static IEnumerable<string> ReadAllLines(this StringReader reader)
|
||||
{
|
||||
while (reader.ReadLine() is { } line)
|
||||
{
|
||||
yield return line;
|
||||
}
|
||||
}
|
||||
|
||||
public static IEnumerable<string> ReadAllLines(this string text)
|
||||
{
|
||||
return new StringReader(text).ReadAllLines();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user