Cognizant Interview Question

basic string manipulation program asked