The spy life - is there a shorter way to do it? | SoloLearn: Learn to code for FREE!

+1

The spy life - is there a shorter way to do it?

https://code.sololearn.com/cfB1CSF54j7u/?ref=app

5/15/2020 11:01:12 AM

Bodnar Leonard

1 Answer

New Answer

+1

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.