using static System.Console;
using static System.Convert;
WriteLine(WrapString("0123456789012345678901234567890123456789", 10));
WriteLine(WrapString("01234567890123456", 10));
WriteLine(WrapString("012345", 10));
static string WrapString(string text, int len) {
if (text.Length <= len) return text;
StringBuilder sb = new(text.Length + text.Length / len * 2);
for (; i < text.Length / 10; i++) {
sb.Append(text[(i * 10)..(i * 10 + 10)]);
if (text.Length / 10 != ToSingle(text.Length) / 10) {
sb.Append(text[(i * 10)..]);
} else sb.Remove(sb.Length - 2, 2);