The Single UNIX ® Specification, Version 2
Copyright © 1997 The Open Group

 NAME

strstr - find a substring

 SYNOPSIS



#include <string.h>

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

 DESCRIPTION

The strstr() function locates the first occurrence in the string pointed to by s1 of the sequence of bytes (excluding the terminating null byte) in the string pointed to by s2.

 RETURN VALUE

Upon successful completion, strstr() returns a pointer to the located string or a null pointer if the string is not found.

If s2 points to a string with zero length, the function returns s1.

 ERRORS

No errors are defined.

 EXAMPLES

None.

 APPLICATION USAGE

None.

 FUTURE DIRECTIONS

None.

 SEE ALSO

strchr(), <string.h>.

DERIVATION

Derived from the ANSI C standard.

UNIX ® is a registered Trademark of The Open Group.
Copyright © 1997 The Open Group
[ Main Index | XSH | XCU | XBD | XCURSES | XNS ]