Re: Question: How to create this function

From: Valery Tsekhmister <valera_at_rinform.labor.ru>
Date: Thu, 7 Jan 1999 17:28:33 +0300
Message-ID: <772g88$9sm$1_at_news.sovam.com>


Hi !

If all you want is to get n-th char from comma delimited char-list, the decision is very simple:

  return substr('A,B....',(n-1)*2+1,1); -- ie this returns 'A' for n=1, 'B' for n=2 etc.

Regards !

Ming Liu wrote in message <01be39ec$d07bec40$e8344f0c_at_grace>...
>Hi. Folks:
>I want to create a function called get_item to do the following.
>get_item('A,B,C,D,E,F,G', 1, ',') = 'A'
>get_item('A,B,C,D,E,F,G', 2, ',') = 'B'
>get_item('A,B,C,D,E,F,G', 3, ',') = 'C', etc.
>Thanks for hints.
Received on Thu Jan 07 1999 - 15:28:33 CET

Original text of this message