Pergunta de entrevista da empresa Thoughtworks

i was asked string manipulation