We will search the string below for the word "World" and see what the program returns.
After running this program, we get an output of 7, because the word "World" starts at the index location of 7.
You can also make your program "smarter" by adding in if-else statements to know whether a substring was found
This is shown in the program below: