PL/SQL Replace

The REPLACE function replaces a set of characters in a string with another set of characters.

Replace syntax

REPLACE( string, string_to_replace, [ replacement_string ] )

Replace example

 
select replace('123PL/SQL', '123')from dual;	

Result: PL/SQL


select replace('123PL/SQL', '123', 'Tutorial ')from dual;	

Result: Tutorial PL/SQL


select replace('01book0123', '01')from dual;	

Result: book23


select replace('00002014', '0')from dual;		

Result: 214


select replace('version_1', '1', '2')from dual;		

Result: version_2