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);
54 if (length_haystack < length_needle)
57 length_haystack -= length_needle;
59 for (i = 0; i <= length_haystack; i++)
63 for (j = 0; j < length_needle; j++)
70 if (toupper(c1) != toupper(c2))
73 return (
char *) haystack + i;
char * strcasestr(const char *haystack, const char *needle)
Locatea substring into a string, ignoring case.