Question: Write code that takes two strings from the user, and finds the index of the second string inside the first. For example, happybirthhappyday and happy

Write code that takes two strings from the user, and finds the index of the second string inside the first. For example, happybirthhappyday and happy yields the result 10. If the substring is not in the string more than once, your code should return -1.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!