# PetscStrstr
Locates first occurrence of string in another string 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscStrstr(const char haystack[], const char needle[], char *tmp[])
```
Not Collective


## Input Parameters

- ***haystack -*** string to search
- ***needle -*** string to find



## Output Parameter

- ***tmp -*** location of occurrence, is a NULL if the string is not found



## Fortran Note
Not for use in Fortran




## See Also
 `PetscStrbeginswithwhich()`, `PetscStrendswith()`, `PetscStrtoupper`, `PetscStrtolower()`, `PetscStrrchr()`, `PetscStrchr()`,
`PetscStrncmp()`, `PetscStrlen()`, `PetscStrncmp()`, `PetscStrcmp()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/utils/str.c.html#PetscStrstr">src/sys/utils/str.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex47cu.cu.html">src/snes/tutorials/ex47cu.cu.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/sys/utils/str.c)


[Index of all Sys routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
