New course! Every coder should learn Generative AI!
Try a free lesson+ 2
Covert input string to a stringbuilder object and use its reverse method to reverse the string. Then convert tochararray(). Then use 1 for in loop to go over each character and use isLetter() and isSpace() if either returns true add current char to a new string. Output new string after loop.
I suppose you could also skip the string builder part and just add the chars to the front of the new string too.