Built-in Functions → replace

replace() is a string function that returns a string with substrings replaced by new substrings.

Signature

replace(string field, string old, string new)

The following table illustrates the replace() parameters:

ParameterDescription
string fieldstring to search
string oldstring to search for in string field
string newstring to replace string old with in string field

Returns

string

Example

Replace the product category data that match "Electronics and Hardware" with "Electronics.

replace(Sales.Product.CATEGORY, "Electronics and Hardware", "Electronics")