Files
telegram-bot/modules/CodeWatcher/StringExtension.cs
T

14 lines
358 B
C#
Raw Normal View History

2022-04-20 00:38:47 +03:00
namespace West.TelegramBot.CodeWatcher;
public static class StringExtension
{
// https://stackoverflow.com/a/23408020
public static IEnumerable<string> SplitToLines(this string input)
{
2023-07-28 16:53:01 +03:00
using var reader = new StringReader(input);
while (reader.ReadLine() is { } line)
2022-04-20 00:38:47 +03:00
{
2023-07-28 16:53:01 +03:00
yield return line;
2022-04-20 00:38:47 +03:00
}
}
}