PL/SQL Rtrim

The Rtrim function removes characters from the right-hand side of an expression.

Rtrim syntax

RTRIM( expression, [ trim_expression ] ) 

Rtrim example

select rtrim('example ') from dual;

Result: example


select rtrim('000function000', '0') from dual;	

Result: 000function


select rtrim('PHP123', '123') from dual;		

Result: PHP


select rtrim('123PHP123123', '123') from dual;	

Result: 123PHP


select rtrim('TestxyzXYZ', 'XYZ') from dual;		

Result: Testxyz


select rtrim('Testabcccbaabc', 'cba') from dual;

Result: Test


select rtrim('Java12345', '0123456789') from dual;

Result: Java