loop
ipos:=instr(strsql,'\');--取得'\'的位置
exit when ipos=0;
strsql:=substr(strsql,ipos+1,length(strsql)-ipos+1);--去掉'\'
end loop;
dbms_output.putline(strsql);
ipos:=instr(strsql,'\');--取得'\'的位置
exit when ipos=0;
strsql:=substr(strsql,ipos+1,length(strsql)-ipos+1);--去掉'\'
end loop;
dbms_output.putline(strsql);
上面的可以写成这样:
select substr('\images\blank16w.gif',instr('\images\blank16w.gif','\',-1) + 1 ) from dual;
string str="\images\blank16w.gif";
int i=str.LastIndex("\\");//str中最后一个“\”的索引
string strImgName=str.substring(i+1);//s索引从零开始,所以加1
strImgName就是图片名