mirror of
https://github.com/Bubuni-Team/telegram-bot.git
synced 2026-07-31 00:29:24 +03:00
17 lines
425 B
C#
17 lines
425 B
C#
|
|
namespace West.TelegramBot.CodeWatcher;
|
||
|
|
|
||
|
|
public static class StringExtension
|
||
|
|
{
|
||
|
|
// https://stackoverflow.com/a/23408020
|
||
|
|
public static IEnumerable<string> SplitToLines(this string input)
|
||
|
|
{
|
||
|
|
using (var reader = new StringReader(input))
|
||
|
|
{
|
||
|
|
string line;
|
||
|
|
while ((line = reader.ReadLine()) != null)
|
||
|
|
{
|
||
|
|
yield return line;
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|