Question: This lab is supposed to be completed by recursion ONLY. The goal here is to check to see if one string is a substring of

This lab is supposed to be completed by recursion ONLY.

The goal here is to check to see if one string is a substring of another. Strings in Java already have such a method, but we're going to implement it recursively! Create a class that has one method: .contains(), which takes two Strings as parameters and returns whether or not the first string contains the second one. For example: MyClass.contains("The semester is almost over, finally!", "semester"); //should return true. Try to think of how you can, piece-by-piece, check whether or not parts of the larger String equal the smaller String

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!