1. Home
  2. Computing & Technology
  3. Linux
Linux / Unix Command: strstr
Command Library

NAME

strstr - locate a substring  

SYNOPSIS

#include <string.h>

char *strstr(const char *haystack, const char *needle);
 

DESCRIPTION

The strstr() function finds the first occurrence of the substring needle in the string haystack. The terminating `\0' characters are not compared.  

RETURN VALUE

The strstr() function returns a pointer to the beginning of the substring, or NULL if the substring is not found.  

SEE ALSO

index(3), memchr(3), rindex(3), strchr(3), strpbrk(3), strsep(3), strspn(3), strtok(3)


Important: Use the man command (% man) to see how a command is used on your particular computer.

>> Linux/Unix Command Library

>> Shell Command Library

Explore Linux
About.com Special Features

Stay connected and entertained with reviews on tips on the latest HDTVs, cellphones and more. More >

Easy ways to connect two computers for networking purposes. More >

  1. Home
  2. Computing & Technology
  3. Linux

©2009 About.com, a part of The New York Times Company.

All rights reserved.