title: Problem having on Java; replace the character
body: <pre><code>public static int conversion(int n) {
  
      String str = Integer.toString(n);    //int to string
      String str1= str.replace('0', '5'); //replace the character in string
      int result1 = Integer.parseInt(str1); //string to int
  
      int result = result1;
  
      return result;
  
  
  }
  </code></pre>
  <p>I'm trying to replace the character from '0' to '5'.
  The current code works, but only when there is no '0' at the front.</p>
  <p>example: '50005' -&gt; '55555' (o) ; '00005000' -&gt; '5555' (x) &lt;-front '0' didn't change</p>
  <p>What should I add or know to fix this error?</p>