Collections:
REPLACE() - Replacing Substring
How to replace a substring in a given string using the REPLACE() function?
✍: FYIcenter.com
REPLACE(str, from_str, to_str) is a MySQL built-in function that
repeats a substring in a given string.
For example:
SET @str = 'dba.FYIcenter.com'; SELECT REPLACE(@str, 'dba', 'dev'); -- +-----------------------------+ -- | REPLACE(@str, 'dba', 'dev') | -- +-----------------------------+ -- | dev.FYIcenter.com | -- +-----------------------------+
Reference information of the REPLACE() function:
REPLACE(str, from_str, to_str): modstr Returns the string str with all occurrences of the string from_str replaced by the string to_str. REPLACE() performs a case-sensitive match when searching for from_str. Arguments, return value and availability: str: Required. The given string to be modified. from_str: Required. The substring to be replaced. to_str: Required. The string to be replaced with. modstr: Return value. The modified string. Available since MySQL 4.0.
⇒ REVERSE() - Reversing String
2023-11-13, 1502🔥, 0💬
Popular Posts:
How To Update Multiple Rows with One UPDATE Statement in SQL Server? If the WHERE clause in an UPDAT...
How To Get the Definition of a View Out of the SQL Server in SQL Server? If you want get the definit...
How To Use DATEADD() Function in SQL Server Transact-SQL? DATEADD() is a very useful function for ma...
Where Is the Export Dump File Located in Oracle? If you are not specifying the dump directory and fi...
What is SQL Server Transact-SQL (T-SQL)? SQL Server Transact-SQL, also called T-SQL, is an extension...