All pastes #368607 Raw Edit

Something

public text v1 · immutable
#368607 ·published 2007-02-23 05:28 UTC
rendered paste body
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