📣
TiDB Cloud Premium is now in public preview. Unlimited growth, instant elasticity, advanced security for enterprise workloads. Try it out →

REPLACE



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

Syntax

REPLACE(<str>, <from_str>, <to_str>)

Arguments

ArgumentsDescription
<str>The string.
<from_str>The from string.
<to_str>The to string.

Return Type

VARCHAR

Examples

SELECT REPLACE('www.mysql.com', 'w', 'Ww'); +-------------------------------------+ | REPLACE('www.mysql.com', 'w', 'Ww') | +-------------------------------------+ | WwWwWw.mysql.com | +-------------------------------------+

Was this page helpful?