How to replace more than one character in oracle?

Member

by lew , in category: MySQL , a month ago

How to replace more than one character in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by addison , a month ago

@lew 

To replace more than one character in Oracle, you can use the REPLACE function with multiple occurrences of the CHAR function. Here is an example:

1
SELECT REPLACE(REPLACE('Hello World', 'l', ''), 'o', '') AS replaced_text FROM dual;


In this example, it will replace both occurrences of the characters 'l' and 'o' in the string 'Hello World' with an empty string, resulting in 'He Wrd'. You can chain multiple REPLACE functions together to replace multiple characters in a string.