using System;
using System.Collections.Generic;
public class Test
{
static List<String> DividirBlocos(string texto, int blocos){
var partes = new List<String>();
int tamanho = texto.Length;
// Incrementa "i" conforme o valor de "blocos". 0, 12, 24, 36...
for (int i = 0; i < tamanho; i += blocos){
if (i + blocos > tamanho) blocos = tamanho - i;
partes.Add(texto.Substring(i, blocos));
}
return partes;
}
public static void Main()
{
var texto = "13032015joao14032014Juca25";
var partes = DividirBlocos(texto, 12);
foreach (var parte in partes){
Console.WriteLine(parte);
// 13032015joao
// 14032014Juca
// 25
}
Console.ReadLine();
}
}
dXNpbmcgU3lzdGVtOwp1c2luZyBTeXN0ZW0uQ29sbGVjdGlvbnMuR2VuZXJpYzsKCnB1YmxpYyBjbGFzcyBUZXN0CnsKCXN0YXRpYyBMaXN0PFN0cmluZz4gRGl2aWRpckJsb2NvcyhzdHJpbmcgdGV4dG8sIGludCBibG9jb3MpewoJCXZhciBwYXJ0ZXMgPSBuZXcgTGlzdDxTdHJpbmc+KCk7CgkJaW50IHRhbWFuaG8gPSB0ZXh0by5MZW5ndGg7CgkJLy8gSW5jcmVtZW50YSAiaSIgY29uZm9ybWUgbyB2YWxvciBkZSAiYmxvY29zIi4gMCwgMTIsIDI0LCAzNi4uLgoJCWZvciAoaW50IGkgPSAwOyBpIDwgdGFtYW5obzsgaSArPSBibG9jb3MpewoJCQlpZiAoaSArIGJsb2NvcyA+IHRhbWFuaG8pIGJsb2NvcyA9IHRhbWFuaG8gLSBpOwoJCQlwYXJ0ZXMuQWRkKHRleHRvLlN1YnN0cmluZyhpLCBibG9jb3MpKTsKCQkJfQoJCXJldHVybiBwYXJ0ZXM7CiAgICB9CglwdWJsaWMgc3RhdGljIHZvaWQgTWFpbigpCgl7CgkJdmFyIHRleHRvICA9ICIxMzAzMjAxNWpvYW8xNDAzMjAxNEp1Y2EyNSI7CgkJdmFyIHBhcnRlcyA9IERpdmlkaXJCbG9jb3ModGV4dG8sIDEyKTsKCQkKCQlmb3JlYWNoICh2YXIgcGFydGUgaW4gcGFydGVzKXsKCQkJQ29uc29sZS5Xcml0ZUxpbmUocGFydGUpOwogICAgICAgICAgICAvLyAxMzAzMjAxNWpvYW8KICAgICAgICAgICAgLy8gMTQwMzIwMTRKdWNhCiAgICAgICAgICAgIC8vIDI1CiAgICAgICAgfQogICAgICAgIENvbnNvbGUuUmVhZExpbmUoKTsKCX0KfQ==