BlackRock interview question

Basic string manipulation question in any language