title: Ruby - replace the first occurrence of a substring with another string
body: <p><code>a = "foobarfoobarhmm"</code></p>
  
  <p>I want the output as `"fooBARfoobarhmm"</p>
  
  <p>ie only the first occurrence of "bar" should be replaced with "BAR".</p>