PL/SQL Trim

The Trim function enables you to remove all specified characters from the start or from the end of a string.

Trim syntax

TRIM( [ leading | trailing | both [ trim_character ] ] string ) 

Trim example

 
select trim(' PL/SQL ') from dual;		

Result: PL/SQL


select trim(leading '0' from '0012300') from dual;	

Result: 12300


select trim(trailing '0' from '0012300') from dual;	

Result: 00123


select trim(both '0' from '0012300') from dual;

Result: 123