Quick way to build string with leading 0s for integer number?
<p>I have built a string for an integer with prefix 0s if need like this way:</p>

<pre><code> // myInt as input, for example: 101;
 List&lt;string&gt; sList = new List&lt;string&gt;();
 string format = "00#"; // how to build format dynamicall?
 for(int i= 1; i &lt;= myInt; i++)
 {
     sList.Add(i.ToString(format));
 }
</code></pre>

<p>The expected result should be:</p>

<pre><code> 001
 002
 ...
 010
 ...
 101
</code></pre>

<p>If my integer number is 10 or 1000, how can I build the format dynamically?</p>
