Domanda di colloquio di Panasonic

Coding questions, Reverse the string but keep special characters on same place.