strstr()

locate first occurrence of a substring within a string 

Function


SYNOPSIS

#include <string.h>

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


DESCRIPTION

The strstr() function finds the first occurrence of substring s2 within string s1, exclusive of the terminating null character.


PARAMETERS

s1 

Points to a null-terminated string in which to search.

s2 

Points to a null-terminated substring for which to search.


RETURN VALUES

The strstr() function returns a pointer to the substring that it found in s1. If it cannot find the substring within s1, strstr() returns a null pointer. The strstr() function returns s1 if s2 points to a zero-length string.


CONFORMANCE

ANSI/ISO 9899-1990.


MULTITHREAD SAFETY LEVEL

MT-Safe.


PORTING ISSUES

None.


AVAILABILITY

PTC MKS Toolkit for Professional Developers
PTC MKS Toolkit for Professional Developers 64-Bit Edition
PTC MKS Toolkit for Enterprise Developers
PTC MKS Toolkit for Enterprise Developers 64-Bit Edition


SEE ALSO

Functions:
strchr(), strcspn(), strpbrk(), strrchr()


PTC MKS Toolkit 10.5 Documentation Build 40.