Utility Functions and C Language Reference > C Language Reference > Alphabetical List of Functions > strstr

strstr

Example: strstr String Manipulation Functions

Returns the first occurrence of one string in another.

char *strstr( const char *string1, const char *string2);

string1 The string that is searched.
string2 The string that is searched for in the first string.

Return Values

Returns a pointer to the first occurrence of string2 in string1. If string2 is not found in string1 the function returns NULL.