using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace BirdyFlash.Lib { public static class Extensions { public static IEnumerable Split(this string str, int n) { if (String.IsNullOrEmpty(str) || n < 1) { throw new ArgumentException(); } for (int i = 0; i < str.Length; i += n) { yield return str.Substring(i, Math.Min(n, str.Length - i)); } } } }