# PetscStrendswithwhich
Determines if a string ends with one of several possible strings 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscStrendswithwhich(const char a[], const char *const *bs, PetscInt *cnt)
```
Not Collective


## Input Parameters

- ***a -*** pointer to string
- ***bs -*** strings to end with (last entry must be NULL)



## Output Parameter

- ***cnt -*** the index of the string it ends with or the index of NULL



## 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#PetscStrendswithwhich">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)  
