reverseString and replace space