Cognizant interview question

Program to find a substring in a string