title: Using String.Format To Dynamically Provide The Max Amount of Padding Needed
body: <p>Hello I am trying to make my Console Application assignment more aesthically pleasing and by doing this I have decided to implement String.Format into my loops. We haven't been taught it but it is pretty easy to pick up. The main problem here is how do I parse a int into the String.Format so that it provides the max space needed.</p>
  
  <p>This is the loop:</p>
  
  <pre><code>for (int index = 0; index &lt; files.Length; index++)
  {
      int maxNumericalSize = 2;
      int fileNumberSystem = index + 1;
      string result = string.Format("{0,maxNumericalSize}: {1,20} - {2,10} - {3}", fileNumberSystem, files[index].Name, files[index].Length, files[index].LastWriteTime );
      /* Console.WriteLine(fileNumberSystem + ". " + files[index].Name + " - " + files[index].Length + " - " + files[index].LastWriteTime); */
      Console.WriteLine(result);
  }
  </code></pre>
  
  <p>As you can see MaxNumericalSize obviously throws an area as it is within speech marks so I am currently wondering how I could parse that into String.Format like that without the error.</p>