请问asp的instr的问题?

来源:百度知道 编辑:UC知道 时间:2024/06/23 23:26:09
<%
dim a,b
a="!@#456@"
b=instr(1,a,"@")
response.write b
%>

<%
dim a,b
a="!@#456@"
b=instr(3,a,"@")
response.write b
%>
有什么办法同时确定@在第二位和@再第七位,我是分开写的,不够先进

哪位道兄,有道行,可以把@在第二位和第七位同时写出来,请指教一下!

<%
dim a,b,j,k
b=0
k=0
a="!@#456@"
for j=1 to len(a)
b=instr(j,a,"@")
if (b<>0 and b<>k) then
k=b
response.write "@的位置是"& b &"<br>"
end if
next
%>

<%
dim a,b
b=1
a="!@#456@"
do while instr(b,a,"@")<>0
response.write(instr(b,a,"@"))
b=instr(b,a,"@")+1
loop
%>
还有问题,发消息给我..