:orphan:
# PetscStrstr
Locates first occurrence of string in another string 
## Synopsis
```
static inline PetscErrorCode PetscStrstr(const char haystack[], const char needle[], char *tmp[])
```
Not Collective, No Fortran Support


## Input Parameters

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



## Output Parameter

- ***tmp -*** location of `needle` within `haystack`, `NULL` if `needle` is not found





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

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscstring.h.html#PetscStrstr">include/petscstring.h</A>

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscstring.h)


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