October's "Regular" PL/SQL Puzzler!

From: Cam White <info_at_revealnet.com>
Date: 1997/10/15
Message-ID: <01bcd977$4f15dde0$1173b1cd_at_Preveal2>#1/1


Solve this month's PL/SQL Puzzle, and you will be eligible to win a free technical book from O'Reilly& Associates. Just visit the "PL/SQL Pipeline" from http://www.revealnet.com - and submit your answer. Deadline for responses is
Friday, October 30.

So, first to our regular puzzle of the month:

Build a variation of LTRIM that recognizes and trims by patterns. You are probably all familiar with LTRIM. PL/SQL offers this function to remove characters from the beginning of a string, but this function has its limitations. It does not allow you to remove a pattern of characters. Instead, any of the characters that appear in the trim string are removed.

Suppose, for example, that I have I want to remove all leading occurrences of "abc" from the string "abcabcadef". One might instinctively try this:

v_newstring := LTRIM ('abcabcadef', 'abc');

But if you do this you will end up with "def", since that last, lonely "a" will also be trimmed.

...There's much more behind this puzzle. Please visit http://www.revealnet.com for full information. Best wishes,

Cam White
RevealNet, Inc.
(202) 234-8557 Received on Wed Oct 15 1997 - 00:00:00 CEST

Original text of this message