# PetscStrreplace
Replaces substrings in string with other substrings 
## Synopsis
```
#include "petscsys.h"   
PetscErrorCode PetscStrreplace(MPI_Comm comm, const char aa[], char b[], size_t len)
```
Not Collective


## Input Parameters

- ***comm -*** `MPI_Comm` of processors that are processing the string
- ***aa -*** the string to look in
- ***b -*** the resulting copy of a with replaced strings (b can be the same as a)
- ***len -*** the length of b



## Notes
Replaces   ${PETSC_ARCH},${PETSC_DIR},${PETSC_LIB_DIR},${DISPLAY},
${HOMEDIRECTORY},${WORKINGDIRECTORY},${USERNAME}, ${HOSTNAME} with appropriate values
as well as any environmental variables.

`PETSC_LIB_DIR` uses the environmental variable if it exists. `PETSC_ARCH` and `PETSC_DIR` use what
PETSc was built with and do not use environmental variables.


## Fortran Note
Not for use in Fortran




## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/sys/utils/str.c.html#PetscStrreplace">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)  
