Description
The REPLACE( ) function returns the string (str) with all occurrences of string from_str replaced by a string to_str. This function performs a case-sensitive match while searching in from_str.
This function has the form:
SELECT REPLACE(str,from_str,to_str)
Parameter | Description |
---|---|
str | A string |
from_str | From a string |
to_str | To a string |
Return Value
The string (str) with all occurrences of string from_str replaced by a string to_str.
Examples
The following example shows the basic use of this function:
mysql> SELECT REPLACE('www.mysql.com', 'w', 'Ww');
-> 'WwWwWw.mysql.com'