How to replace more than one character in oracle?

Member

by lew , in category: MySQL , 8 months ago

How to replace more than one character in oracle?

Facebook Twitter LinkedIn Telegram Whatsapp

1 answer

Member

by addison , 8 months 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.