title: How to format a string with fixed width fields
body: <p>I'm was wondering if there is a way to format a string to format a string, what I mean is, I have a foreach loop that get a information from some files and how many records has each file, as the length of each file is different the format is change.</p>
  
  <p>My example is, I have 3 files:</p>
  
  <pre><code> 1.- MyFile1.txt   RecordCount: 5
   2.- anotherfile.txt    RecordCount: 8
   3.- MyTestFile.doc   RecordCount: 17
  </code></pre>
  
  <p>As you can see are not formated, I want something like this:</p>
  
  <pre><code> 1.- MyFile1.txt        RecordCount: 5
   2.- anotherfile.txt    RecordCount: 8
   3.- MyTestFile.doc     RecordCount: 17
  </code></pre>
  
  <p>does not matter the length of the file, RecordCount will be in the same place.</p>
  
  <p>What I have is this:</p>
  
  <pre><code> foreach (RemoteFileInfo file in MySession.EnumerateRemoteFiles(directory.RemoteDirectory, directory.RemoteFiles, EnumerationOptions.None))
   {
       BodyMessage.Append((index + 1) + ". " + file.Name + "        Record Count: " + File.ReadAllLines(Path.Combine(directory.LocalDirectory, file.Name)).Length.ToString() + "\n");
       index++;
   }
  </code></pre>
  
  <p>Any idea?</p>