Files
doris/docs/en/sql-reference/sql-functions/string-functions/replace.md
xinghuayu007 bfb39a2826 [SQL][Function] Add replace() function (#4347)
replace is an user defined function, which is to replace all old substrings with a new substring in a string, as follow:
mysql> select replace("http://www.baidu.com:9090", "9090", "");
+------------------------------------------------------+
| replace('http://www.baidu.com:9090', '9090', '') |
+------------------------------------------------------+
| http://www.baidu.com: |
+------------------------------------------------------+
2020-08-20 09:28:53 +08:00

1.3 KiB

title, language
title language
replace zh-CN

replace

description

Syntax

VARCHAR REPLACE (VARCHAR str, VARCHAR old, VARCHAR new)

replace all old substring with new substring in str

example

mysql> select replace("http://www.baidu.com:9090", "9090", "");
+------------------------------------------------------+
| replace('http://www.baidu.com:9090', '9090', '') |
+------------------------------------------------------+
| http://www.baidu.com:                                |
+------------------------------------------------------+

keyword

REPLACE