JPMorganChase Interview Question

One question was related to string manipulation