Challenge: Check Substring
Explore how to verify if a specific substring exists within a larger string in Perl. Learn to apply built-in string functions to return precise results, enhancing your understanding of string manipulation and conditional logic in Perl programming.
We'll cover the following...
We'll cover the following...
Problem statement
In this challenge, you have to write code that checks if a string contains a specific string. Your code should return 1 if it does else return -1.
Sample input
The quick brown fox jumps over the lazy dog.
Check whether the said string contains the string jumps.
Sample output
1
Hint: Use the built-in functions you learned about in the previous lesson.
Important Note: Your code needs to pass all three test cases in order to be considered correct.