How to Replace Substrings

Postgres provides the following string replacement function:

with fruits as (select unnest(fruits) AS fruit_name from array_example )
select replace(fruit_name,’ap’,’AP’) from fruits;
Fruit_name
grAPe
APple
Orange
peach

IN THIS PAGE