Pergunta de entrevista da empresa GfyCat

Basic string manipulation question in language of your choice.