how to reverse each word in given string