Amazon interview question

Accept a continuous string input and manipulate it as required.