In the C Programming Language, the strstr function searches inside the string pointed to by way of s1 for the string pointed to with the aid of s2. It returns a pointer to the first occurrence in s1 of s2.
Syntax
The syntax for the strstr function in the C Language is:
char *strstr(const char *s1, const char *s2);
Parameters or Arguments
s1 A string to search within. s2 The substring that you prefer to find.
Returns
The strstr function returns a pointer to the first incidence s2 within the string pointed to via s1. If s2 isn’t always found, it returns a null pointer.
Required Header
In the C Language, the required header for the strstr characteristic is:
#include <string.h>
Applies To
In the C Language, the strstr feature can be used in the following versions:
ANSI/ISO 9899-1990
See Also
Other C features that are noteworthy when dealing with the strstr function:
memchr characteristic strchr function strpbrk characteristic strrchr function
Leave a Review