Oracle TRIM

The Oracle TRIM function enables you to trim leading or trailing characters (or both) from a character string.

Oracle TRIM example

select 
trim(' tutorial ') 
from dual;

Result: 'tutorial'

select 
trim(leading '1' from '111089711091') 
from dual;

Result: '089711091'

select 
trim(trailing '9' from 'Oracle9') 
from dual;

Result: 'Oracle'

select 
trim(both '1' from '111Oracle10G11') 
from dual;

Result: 'Oracle10G'