Indeed, it works as expected. I wonder why I thought strings were mutable.