JPMorganChase interview question

One question was related to string manipulation