PetscStrlen — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# 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

## Note

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

## See Also

`PetscStrallocpy()`

## Level

intermediate

## Location

include/petscstring.h

## Examples

src/ts/tutorials/ex48.c
src/ts/tutorials/ex18.c

Index of all Sys routines
Table of Contents for all manual pages
Index of all manual pages