a = "foobarfoobarhmm"
I want the output as `"fooBARfoobarhmm"
ie only the first occurrence of "bar" should be replaced with "BAR".