title: C#: How to format a string using string.Format without knowing the size of an array?
body: <p>I have an array in a loop.</p>
  
  <p>At a time, the array could have a different size(could be <code>1,2,3,4,5,6,7,8</code> etc elements)</p>
  
  <p>How could I use the <code>string.Format</code> without specifying the exact size of the array:</p>
  
  <p>Code in case of a list with 6 members.</p>
  
  <pre><code>StringBuilder stringBuilder = new StringBuilder();
                                line = stringBuilder.AppendLine(string.Format("{0, -40} 
                                {1, -40} {2, -25} {3, -15} {4, -15} {5, -15} ",
                                listString[0], listString[1], listString[2],
                                listString[3], listString[4], listString[5]))
                                .ToString();
  
  Console.WriteLine(line)
  </code></pre>
  
  <p>I need a piece of code which formats my string without writing a specific code in case of a specific number of elements. Any feature I don't know? :)</p>