SysTutorials

Man Pages › Section 3

strstr(3)

strstr, strcasestr – locate a substring

Synopsis

#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 (‘