public static string PrintAsTables()
{
string reg = Pi;
reg = reg.Insert(2, Environment.NewLine);
int times = 0;
for (int x = 14; x <= reg.Length - 1; x = x + 10)
{
times += 1;
if (times == 5)
{
reg = reg.Insert(x, Environment.NewLine);
x = x + 2;
times = 0;
}
else
{
reg = reg.Insert(x, " ");
}
}
return reg;
}
It's all about
Environment.NewLine
its definied by Environment but in windows is 2 special chars
"\r\n"
so if u inserting into string
Environment.NewLine
next index to display should be incremented too.