strcasestr (3)
Leading comments
Copyright 1993 David Metcalfe (david@prism.demon.co.uk) %%%LICENSE_START(VERBATIM) Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Sin...
NAME
strstr, strcasestr - locate a substringSYNOPSIS
#include <string.h> char *strstr(const char *haystack, const char *needle); #define _GNU_SOURCE /* See feature_test_macros(7) */ #include <string.h> char *strcasestr(const char *haystack, const char *needle);
DESCRIPTION
The strstr() function finds the first occurrence of the substring needle in the string haystack. The terminating null bytes (aq\0aq) are not compared.The strcasestr() function is like strstr(), but ignores the case of both arguments.
RETURN VALUE
These functions return a pointer to the beginning of the located substring, or NULL if the substring is not found.ATTRIBUTES
For an explanation of the terms used in this section, see attributes(7).Interface | Attribute | Value |
strstr() | Thread safety | MT-Safe |
strcasestr() | Thread safety | MT-Safe locale |
CONFORMING TO
strstr(): POSIX.1-2001, POSIX.1-2008, C89, C99.The strcasestr() function is a nonstandard extension.