If you want to find the index of a substring in a string, use find()
method. This method will return the index of the first occurrence of the substring if found and return -1 otherwise.
You can also provide the starting and stopping position of the search as shown above.