Replace Text | TEXT_REPLACE

Syntax

TEXT_REPLACE( [value], [search], [replace] )

Parameters

value
The TEXT value

search
The TEXT value to be replaced. It may also be a string representing a regular expression to match using a pattern.

replace
A TEXT to replace the SEARCH within the VALUE. If

Return Value

A new TEXT value that is a portion of the provided VALUE.

Description

Replace part of a TEXT value.

Examples

TEXT_REPLACE() # returns ""
TEXT_REPLACE("InstaLog.io", "og", "ink") # returns "InstaLink.io"
TEXT_REPLACE("InstaLog.io", "/og/", "ink") # returns "InstaLink.io"
TEXT_REPLACE("apple banana", "a", "z") # returns "zpple bznznz"
TEXT_REPLACE("Apple Banana", "/a/", "z") # returns "Apple Bznana"
TEXT_REPLACE("Apple Banana", "/a/i", "z") # returns "zpple Banana"
TEXT_REPLACE("Apple Banana", "/a/g", "z") # returns "Apple Bznznz"
TEXT_REPLACE("This is a nice sentence.", "/\W/", "-") # returns "This-is-a-nice-sentence-"
Regular expression characters should be escaped properly.
TEXT_REPLACE("https://instalink.io", "/https?:\\/\\//gi", "")
# returns "instalink.io"