Skip to content

Returns the string str with all occurrences of the string from_str replaced by the string to_str.

func.replace(<str>, <from_str>, <to_str>)
func.replace(<str>, <from_str>, <to_str>)
┌──────────────────────────────────────┐
│ func.replace('plaidCloud', 'p', 'P') │
├──────────────────────────────────────┤
│ PlaidCloud │
└──────────────────────────────────────┘
REPLACE(<str>, <from_str>, <to_str>)
ArgumentsDescription
<str>The string.
<from_str>The from string.
<to_str>The to string.

VARCHAR

SELECT REPLACE('www.mysql.com', 'w', 'Ww');
┌─────────────────────────────────────┐
REPLACE('www.mysql.com', 'w', 'Ww') │
├─────────────────────────────────────┤
WwWwWw.mysql.com │
└─────────────────────────────────────┘