Who said you had to make the changes to the original string? Copy it, then reference back to the original as you make the changes, finally return the copy when it's all done :D