Pregunta de entrevista de Lendlord

Some string manipulation question. Nothing too complicated.