On Wed, 2002-08-14 at 16:08, Joe Conway wrote:
> I already have a function in contrib/dblink, currently called 
> dblink_strtok(), which I was going to turn into a builtin function per 
> recent discussion (renamed of course). It would work for this but is 
> more general:
> 
> dblink_strtok(text inputstring, text delimiter, int posn) RETURNS text
> 
> Inputs
>    inputstring
>      any string you want to parse a token out of;
>      e.g. 'f=1&g=3&h=4'
>    delimiter
>      a single character to use as the delimiter;
>      e.g. '&' or '='
>    posn
>      the position of the token of interest, 0 based;
>      e.g. 1
> 
> Should it be called splitstr() (similar to substr())?

What about functions

1. split(text,text,int) returns text

2. split(text,text) returns text[]

and why not

3. split(text,text,text) returns text

which returns text from $1 delimited by $2 and $3

-------------
Hannu


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to [EMAIL PROTECTED]

Reply via email to