title: Padding a swift String for printing
body: <p>I'm trying to print a list of Strings all padded to the same width.</p>
  
  <p>In C, I would use something like <code>printf("%40s", cstr),</code> where cstr is a C string.</p>
  
  <p>In Swift, the best I could come up is this:</p>
  
  <pre><code>line += String(format: "%40s",string.cStringUsingEncoding(&lt;someEncoding&gt;))
  </code></pre>
  
  <p>Is there a better way ?</p>