title: Pad digits until string is 8 chars long in java?
body: <p>i was reading and couldn't find quite the snippet. I am looking for a function that takes in a string and left pads zeros (0) until the entire string is 8 digits long. All the other snippets i find only lets the integer control how much to pad and not how much to pad until the entire string is x digits long. in java.</p>
  
  <p>Example</p>
  
  <blockquote>
    <p>BC238 => 000BC289<br>
    4 => 00000004</p>
  </blockquote>
  
  <p>etc thanks.</p>