strstr

Searches for the occurrence of a specified partial character string

#include <strings.h>
char *strstr (
        const char *s1,
        const char *s2
)

Arguments

s1 Pointer to target character string to be searched
s2 Pointer to character string to be located

Return Value

A pointer to the position of the located string pointed to by s2 within the string pointed to by s1 is returned. NULL is returned if the string pointed to by s2 is not contained within the string pointed to by s1.

Explanation

The first occurrence of the string pointed to by s2 is located within the string pointed to by s1. A pointer to the position of s2 within the string pointed to by s1 is returned.