int getIndex(char *haystack, char *needle, int offset){ char *ind; int index; ind = strcasestr(haystack, needle); if(ind != NULL){ index = ind - haystack; if(index < 0) return -1; else return index+offset; } // end if return -1; } // end getIndex