Cognizant interview question

basic string manipulation program asked