IBM interview question

A question on String manipulation