strstr will find a sub-string within a string. See also strchr which will look for a character in a string.
Library: string.h
Prototype: char * strstr(const char *s1, const char *s2);
Syntax: char string1[]="red dwarf";
char string2[]="dwarf";
void *pointer;
pointer = strstr(string1, string2);
strstr returns a pointer to the beginning of the sub-string or NULL if not found.
/*****************************************************************
*
* Purpose: Program to demonstrate the 'strstr' function.
* Author: M J Leslie
* Date: 18-Jun-94
*
*****************************************************************/
#include <stdio.h>
#include <string.h>
main()
{
char string[]="string to search";
char test[]="sear";
/* strstr returns a pointer into 'string'
* if 'test' is found' if not found, NULL
* is returned. */
if (strstr(string, test)) puts("String found");
}