The common usage is to remove spaces. How many people do not know that they can actually remove spaces? It has the ltrim () and ltrim (x, y) Methods ------- to remove spaces on both sides, and to leave null.
The common usage is to remove spaces. How many people do not know that they can actually remove spaces? It has the ltrim () and ltrim (x, y) Methods ------- to remove spaces on both sides, and to leave null.
The common usage is to remove spaces. How many people do not know that they can actually remove spaces? It has the ltrim () and ltrim (x, y) methods.
------- Go to the two sides of the space, go to the left space, go to the right space --------
Select trim ('x-rapido ') name from dual; 'X-rapido' is returned'
Select ltrim ('x-rapido ') name from dual; 'X-rapido' is returned'
Select rtrim ('x-rapido ') name from dual; returns ''x-rapido''
Select trim (null) name from dual; return null
Ltrim (x, y) syntax
The ltrim (x, y) function intercepts the characters in x one by one based on the characters in y, and runs them from the left. As long as some characters in y are met, the characters in x will be truncated, the Function Command ends only when y is not included in the x character.
Select ltrim ('abcababababe ',' AB ') word from dual;
Result: cdabababe
Select ltrim ('aaaaa', 'A') word from dual;
Result: null is null.
Select ltrim ('20140901', '20160901') nums from dual;
Result: 224323
Select ltrim ('20140901', '20160901') nums from dual;
Result: 4323
Select ltrim ('20140901', '20160901') nums from dual;
Result: 224323
Select ltrim ('20140901', '20160901') nums from dual;
Result: 200111000991110224323
Select ltrim ('20140901', '20160901') nums from dual;
Result: 2100111000991110224323
Note: Oracle is case sensitive.
Select ltrim ('abcdab', 'B') word from dual;
Result: abcdab
As for the rtrim function, like ltrim, one starts from the left and the other starts from the right.
The string truncation function is different from the substr function, because one is a specified character and the other is a specified subscript.