IBM Interview Question

A question on String manipulation