# PetscStrchr
Locates first occurrence of a character in a string 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscStrchr(const char a[], char b, char *c[])
```
Not Collective


## Input Parameters

- ***a -*** pointer to string
- ***b -*** character



## Output Parameter

- ***c -*** location of occurrence, NULL if not found





## Fortran Note
Not for use in Fortran


## See Also
 `PetscStrrchr()`, `PetscTokenCreate()`, `PetscStrendswith()`, `PetscStrbeginsswith()`

## Level
intermediate

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


---
[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)  
