A simple solution would be to write a method that checks if a character is special or not, e.g. call it isSpecialChar() that returns a boolean. If you're unfamiliar as of how to do it, check representing chars using ASCII values. It's pretty basic and straightforward.
Somewhat you have to do the following: check the character, append to the string appropriately. If this is a word, you can reverse it using another helper method, for instance, reverse() which would return the string reversed. For better performance and learning, try using string builder instead of regular string.
References: How to get ASCII from char
About String builders