I have a string like this:
The planet is very big and the planet is heavy.
An example would be, start at the word
heavy, search for the word
planet, but stop at the word
big. The second instance of
planet in this example is what I want, not the first. Therefore if there is not an instance of
heavy then I want to yield an indexOf -1.
Edit: I can accomplish this by splitting my string on the word I want than searching the second element of the array for my text but I was wondering if there was a function to do this.