There are a large number of ways to find the first occurrence of one string within another, and Wiki provides a list of the most common algorithms:
http://en.wikipedia.org/wiki/String_searching_algorithm[
^] - together with explanations of how they work.
From that, you should be able to complete your homework with no further help...