Infosys Interview Question

they asked a string manipulation question