有下列这些字符串,我想判断‘*’和‘-’出现的为止,然后截取‘*’之前的字符串,‘*’到‘-’之间的字符串,‘-’之后的字符串。例:
aaa*2121-9988
bbfdke*2353-235322
哈哈*98739-29938处理后的结果:
a =aaa b=2121 c=9988
a=bbfdk b=2353 c=235322
a=哈哈 b=98739 c=29938
aaa*2121-9988
bbfdke*2353-235322
哈哈*98739-29938处理后的结果:
a =aaa b=2121 c=9988
a=bbfdk b=2353 c=235322
a=哈哈 b=98739 c=29938
substr('xxxxx',instr('xxxxx','*')+1,instr('xxxxx','-')-instr('xxxxx','*')-1)
substr('xxxxx',instr('xxxxx','-')+1)
select substr('gabd*sdff-dfd',0,instr('gabd*sdff-dfd','*')-1) from dual
select substr('gabd*sdff-dfd',instr('gabd*sdff-dfd','*')+1,instr('gabd*sdff-dfd','-')-instr('gabd*sdff-dfd','*')-1) from dual
select substr('gabd*sdff-dfd',instr('gabd*sdff-dfd','-')+1,length('gabd*sdff-dfd')-instr('gabd*sdff-dfd','-')) from dual