reverse a string and in place