Click to See Complete Forum and Search --> : String Parsing


rshivagami
03-30-2001, 11:11 AM
Hi all,

I have a string which I need to parse out and find the position of the first integer in it, like to parse out 'ATM3/0/0' into 'ATM' and '3/0/0'. Does anyone know an easy way of doing it??

Shiva.

m1l
03-30-2001, 11:17 AM
something like this works

select SUBSTR('ATM3/0/0', 1, INSTR(TRANSLATE('ATM3/0/0', '0123456789', '^^^^^^^^^^'), '^') - 1),
SUBSTR('ATM3/0/0', INSTR(TRANSLATE('ATM3/0/0', '0123456789', '^^^^^^^^^^'), '^'))
from dual

the ^ character I have used is any character that is definately not going to be in the string you pass it.

Mike

rshivagami
03-30-2001, 11:32 AM
Thanks a lot Mike.
It works like charm.

Shiva.