17 lines
395 B
C#
17 lines
395 B
C#
namespace AdventOfCode;
|
|
|
|
public static partial 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();
|
|
}
|
|
} |