Skip to main content
`Ctrl`+`K`

# PetscStrbeginswith

Determines if a string begins with a certain string

## Synopsis

    static inline PetscErrorCode PetscStrbeginswith(const char a[], const char b[], PetscBool *flg)

Not Collective, No Fortran Support

## Input Parameters

- a - string to search

- b - string to begin with

## Output Parameter

- flg - `PETSC_TRUE` if `a` begins with `b`, `PETSC_FALSE` otherwise

## Notes

Both `a` and `b` may be `NULL` (in which case `flg` is set to `PETSC_FALSE`) but not either.

`a` and `b` may point to the same string.

## See Also

`PetscStrendswithwhich()`, `PetscStrendswith()`, `PetscStrtoupper`, `PetscStrtolower()`, `PetscStrrchr()`, `PetscStrchr()`, `PetscStrncmp()`, `PetscStrlen()`, `PetscStrcmp()`

## Level

intermediate

## Location

include/petscstring.h

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