replace function

Replaces all occurrences of search with replace.

Syntax

replace(str, search [, replace] )

Arguments

  • str: A STRING expression to be searched.

  • search: A STRING repression to be replaced.

  • replace: An optional STRING expression to replace search with. The default is an empty string.

Returns

A STRING.

If you do not specify replace or is an empty string, nothing replaces the string that is removed from str.

Examples

> SELECT replace('ABCabc', 'abc', 'DEF');
 ABCDEF