# replace()

## Purpose

replace(str, substr_to_replace, replace_with)

Returns new string with all instances of substr_to_replace replaced by replace_with.

## Example

    replace("foo bar baz", " b", ", B")

produces

    "foo, Bar, Baz"

Support: rsyslog Assistant | GitHub Discussions | GitHub Issues: rsyslog source project

Contributing: Source & docs: rsyslog source project

© 2008–2025 Rainer Gerhards and others. Licensed under the Apache License 2.0.