Spy Life CodeCoach Problem (Java) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Spy Life CodeCoach Problem (Java)

I'd appreciate your assistance with this. For this problem, we need to reverse the input, remove special characters and digits, but preserve the spaces (e.g., s4o%^c12a^^t& y><m!! input should output my tacos). I can't seem to get the spaces to stay. Any advice? I've attached my code. Thanks in advance! https://code.sololearn.com/c7O0ZrTTLp2t/?ref=app

11th Jan 2020, 1:58 AM
Melissa N
Melissa N - avatar
2 Answers
+ 4
12-String[] stringArray = reverse.split(""); And you need only one "^" in your regex.
11th Jan 2020, 2:29 AM
Kevin ★
+ 2
Thank you! That worked perfectly.
11th Jan 2020, 2:37 AM
Melissa N
Melissa N - avatar