Skip to main content

$replace

The $replace operator replaces the first occurrence of a substring with a new substring in the original string.

Input

  • An array containing exactly three string values: the original string, the substring to replace, and the new substring

Output

  • The original string with the first occurrence of the specified substring replaced

Examples

Basic Replace

Result: "Hi, world! Hello, universe!"

Field Value

Result: The text field with the first occurrence of “old_word” replaced with “new_word”