# PetscStrrchr
Locates one location past the last occurrence of a character in a string, if the character is not found then returns entire string 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscStrrchr(const char a[], char b, char *tmp[])
```
Not Collective


## Input Parameters

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



## Output Parameter

- ***tmp -*** location of occurrence, a if not found





## Fortran Note
Not for use in Fortran


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

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex43.c.html">src/ksp/ksp/tutorials/ex43.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex72.c.html">src/ksp/ksp/tutorials/ex72.c.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)  
