Files
AdventOfCode/StringExtensions.cs
2022-12-05 14:20:59 +01:00

17 lines
387 B
C#

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();
}
}