title: Adding a 0 if number is less than 10
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/9281078/c-sharp-int-tostring-format-on-2-char-int">C# int ToString format on 2 char int?</a>  </p>
  </blockquote>
  
  
  
  <p>Sorry for the simplicity, but this one is eluding me.  Pretty much I have a list of 36 records, and if the id is less than 10, I need it to return 01, 02, 03... 09, instead of 1, 2, 3... 9.</p>
  
  <p>Here is the code I have so far and I would have thought this would work.  This is C# .NET:</p>
  
  <pre><code>for (int i = 1; i &lt;= 36; i++)
  {
      if (i.ToString().Length == 1)
      {
          i.ToString().PadLeft(2,'0');
      }
  
      Response.Write("Test: " + i);
  }
  </code></pre>
  
  <p>Any help would be appreciated, thanks in advance!</p>