:orphan:
# PetscStrlen
Gets the length of a string 
## Synopsis
```
static inline PetscErrorCode PetscStrlen(const char s[], size_t *len)
```
Not Collective, No Fortran Support


## Input Parameter

- ***s -*** pointer to string



## Output Parameter

- ***len -*** length in bytes





## Notes
This routine is analogous to `strlen()`. `NULL` string returns a length of zero.


## See Also
 `PetscStrallocpy()`

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex18.c.html">src/ts/tutorials/ex18.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex48.c.html">src/ts/tutorials/ex48.c</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)  
