LTRIM and RTRIM#

Functionality:#

This Oracle function will remove characters on the left or right (usually spaces)

Parameters: #

STRING The source, or original, string
CHAR (optional) The last character(s) you want to be retained in the string. Default is blank

Returns: #

Text

Errors: #

None

Operations: #

If start position is 0, then start position is taken as 1

If start position is negative, then substr starts at the end and counts backwards

If length is negative, then NULL is returned

Example:#

rtrim(~) will remove all trailing blanks from the passed string rtrim(ltrim(~)) will remove all leading and trailing blanks from the passed string ltrim(~,’0123456789’) will remove all leading numbers (up to the first non numeric from the passed string (e.g. 57412AB33 would become AB33)


Notes #

Click to create a new notes page