Question about Ltrim
682150Apr 19 2009 — edited Apr 19 2009I am a student in an Oracle SQL class. 10g.
We recently studied Single-Row Functions
One of the functions was LTRIM.
I'm (along with most of the people in the class) a little confused about something.
Our book says that LTRIM is 'LTRIM(c, s) where c represents the data to be affected
and s represents the string to be removed from the left of the data'.
An example is this:
Ltrim('P.O. BOX 123','P.O.') would strip the string 'P.O.' off the front and leave
us with ' BOX 123'. Which is exactly what it does.
But what we found is that
Ltrim('P.O. BOX 123','.OZP') does exactly the same thing.
The order of the characters doesn't seem to matter.
And all of the characters don't need to be present.
To us a 'string' meant a contiguous set of characters in a set order.
However, it looks like in this case string for Ltrim means something more
like 'any of the characters in this set of characters'.
I'm wondering if someone might be able to clarify how LTRIM is working.
Thanks!