43 char *
strcasestr(
const char *haystack,
const char *needle) {
45 size_t length_haystack;
48 if (!haystack || !needle)
51 length_needle = strlen(needle);
52 length_haystack = strlen(haystack) - length_needle + 1;
54 for (i = 0; i < length_haystack; i++)
58 for (j = 0; j < length_needle; j++)
65 if (toupper(c1) != toupper(c2))
68 return (
char *) haystack + i;
char * strcasestr(const char *haystack, const char *needle)
Locatea substring into a string, ignoring case.