The common use is to remove the space, how many people do not know that they can actually do to remove the space, it has LTrim (), LTrim (x, Y) method
------- go to both spaces, go left space, go right space --------Select trim (' x-rapido ') name from dual; Return ' X-rapido ' select LTrim (' x-rapido ') name from dual; Return ' X-rapido ' select RTrim (' x-rapido ') name from dual; Returns ' x-rapido ' select trim (NULL) name from dual; Returns null
LTrim (x, y) syntax
The LTrim (x, y) function truncates the characters in X by one of the characters in Y, and executes from the left, as long as the characters in Y are encountered, the characters in X are truncated until the function command ends in the characters of X that are not in Y.
Select LTrim (' Abcdabababe ', ' ab ') word from dual;
Results: Cdabababe
Select LTrim (' aaaaaa ', ' a ') word from dual;
Result: null empty
Select LTrim (' 109224323 ', ' 109 ') nums from dual;
Results: 224323
Select LTrim (' 10900094323 ', ' 109 ') nums from dual;
Results: 4323
Select LTrim (' 10900111000991110224323 ', ' 109 ') nums from dual;
Results: 224323
Select LTrim (' 109200111000991110224323 ', ' 109 ') nums from dual;
Results: 200111000991110224323
Select LTrim (' 902100111000991110224323 ', ' 109 ') nums from dual;
Results: 2100111000991110224323
Note: Oracle is case sensitive
Select LTrim (' Abcdab ', ' B ') word from dual;
Results: Abcdab
As for the RTrim function, as with LTrim, one starts from the left and one from the right.
The ability to intercept a string differs from the SUBSTR function because one is a specified character, and the other is defined as the
Oracle Do you really use the Ltrim/rtrim function?