title: How Do Insert a char in string (java/groovy)?
body: <p>I have a string like :</p>
  
  <pre><code>string = abcdefghabcd
  </code></pre>
  
  <p>Now lets say I want to replace the first occurrence of <code>a</code>. I tried something like this :</p>
  
  <pre><code>string[string.indexOf('a')] = '0'
  </code></pre>
  
  <p>But this doesn't seems to be working. Any other way I can do  this?</p>
  
  <p>Thanks in advance.</p>