CIS 491 Exercise: Strings

Objectives: Utilize various string functions.

Description: Write a program that takes two strings and tests whether or not one is contained in the other. For example, the string "pen" is contained within the string "independent". Report the starting position of the first string within the second. The program should be able to locate the shorter string within the larger, whatever order they are typed in, and report the starting position of the smaller string in the larger. For example your message should read "The string pen is contained in the string independent beginning at position 4."

If the shorter string is not contained in the longer string, then an appropriate message should be displayed.

Your program should ignore case, so string "Pen" is found in string "independent".

Note that you should add 1 to the position found, since people start counting with 1 even though Java begins with 0.