title: Ruby zerofill a string
body: <p>Formating an Integer to be filled with zeros is easy in Ruby:</p>
  
  <pre><code>sprintf( "%010d", 345 ) #=&gt; "0000000345"
  </code></pre>
  
  <p>But when I try to fill a String with zeros I can't find an easy solution:</p>
  
  <pre><code>sprintf( "%010d", "12AD" ) #=&gt; ArgumentError: invalid value for Integer(): "12AD"
  sprintf( "%010s", "12AD" ) #=&gt; "      12AD"
  </code></pre>
  
  <p>I would like to obtain: </p>
  
  <pre><code>sprintf( "%010s", "12AD" ) #=&gt; "00000012AD"
  </code></pre>