Files
AdventOfCode/StringExtensions.cs
2024-06-03 17:29:56 +02:00

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