title: Java replace hashtags in a string with integer with padding zeros
body: <p><strong>I have a given filename template stored in a <code>String</code> variable, for example: <code>"fileno####save.txt"</code></strong></p>
  
  <p>I have a number between 1-9999 stored in an <code>int</code> variable.</p>
  
  <p>If my number is 2, I'd like to get: <code>"fileno0002save.txt"</code></p>
  
  <p>If my number is 23, I'd like to get: <code>"fileno0023save.txt"</code></p>
  
  <p>If my number is 121, I'd like to get: <code>"fileno0121save.txt"</code></p>
  
  <p>If my number is 2021, I'd like to get: <code>"fileno2021save.txt"</code></p>
  
  <p><strong>Let's see it with a little bit different template: <code>"######fileno.txt"</code></strong></p>
  
  <p>If my number is 2, I'd like to get: <code>"000002fileno.txt"</code></p>
  
  <p>If my number is 23, I'd like to get: <code>"000023fileno.txt"</code></p>
  
  <p>If my number is 121, I'd like to get: <code>"000121fileno.txt"</code></p>
  
  <p>If my number is 2021, I'd like to get: <code>"002021fileno.txt"</code></p>
  
  <p>The length of the int number will never get any bigger than the length of the hashtags so we don't have to deal with that as I have already wrote an exception for that. The length of the hashtag part in the string that I have to deal with is between 2-10 characters.</p>