title: Replace part of a string between indexes in Java
body: <p>Say I have the string <code>123456789</code>. I know that I want to replace indexes 3-5 of the string. (4, 5, and 6). Keep in mind that the replacement probably isn't 3 characters, I might want to end up with <code>123foobar789</code>.</p>
  
  <p>What's the best way to do this?</p>