title: Format String become xxx1, xx10 or 1###, 10## etc
body: <p>I have following numbers : 1, 2, 3, 4, 10</p>
  
  <p>But I want to print those numbers like this:</p>
  
  <pre><code>0001
  0002
  0003
  0004
  0010
  </code></pre>
  
  <p>I have searched in Google. the keyword is number format. But I've got nothing, I just get, format decimal such ass <code>1,000,000.00</code>. I hope you can suggest me a reference or give me something to solve this problem.</p>
  
  <p>Thanks</p>
  
  <p>Edit,
  we can use NumberFormat, or String.format("%4d", somevalue); but it just for adding <code>0</code> character before integer. How If I wanna use character such as <code>x</code>, <code>#</code> or maybe <code>whitespace</code>. 
  So the character become:
  <code>xxxx1</code>
  <code>xxx10</code>  or <code>####1</code> <code>###10</code> or <code>1####</code>  <code>10###</code></p>