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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started