determine if a string contains a substring, and return the start and end indexes if it does