0

Basically I want to display a line of numbers in console, and then align them with next line. I found some solutions how to align text in console, but it doesn't say how to do it in loop.

Here's what I tried to do, but after first iteration, it throws an exception:

for (int i = 1; i <= blanks.GetLength(1); i++)
{
    Console.Write(String.Format("{" + Convert.ToString(i-1) + ",-10} | ", Convert.ToString(i)));
}
marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459

0 Answers0