Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

strstr - find substring in string

&pagelevel(4)&pagelevel

Syntax

#include <string.h>

char *strstr(const char *s1, const char *s2);

Description

strstr() searches for the first occurrence of string s2 (without the terminating null byte) in string s1.

Return val.

Pointer to the start of the string found in s1



if successful.


Null pointer

if s2 is not contained in s1.


Pointer to the start of s1



if s2 has a length of 0.

Notes

Strings terminated with the null byte (\0) are expected as arguments.

See also

strchr(), string.h.