首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > ASP >

怎么写这样的函数

2012-10-16 
如何写这样的函数啊h1i3,4,7,22,11,8,1,556,1211,6543,2134如果判断i中有h的数字[解决办法]%h1i3,

如何写这样的函数啊
h=1
i=3,4,7,22,11,8,1,556,1211,6543,2134

如果判断i中有h的数字

[解决办法]
<%
h="1"
i="3,4,7,22,11,8,1,556,1211,6543,2134"
h=","&h&","
ii=","&i&","
if instr(ii,hh)>0 then
response.write "有"
else
response.write "无"
end if
%> 

[解决办法]
什么叫自己写的函数?你不用vbs,自己开发一种语言就可以了
[解决办法]
<%
h=1
i=3,4,7,22,11,8,1,556,1211,6543,2134
if myInstr(i,h) then
response.write "有"
else
response.write "无"
end if

%>
<%
function myInstr(str1,str2)
temp=false
arr=split(str1,",")
for i=0 to ubound(arr)
if arr(i)=str2 then
temp=true
exit for
end if
next
myInstr=temp
function
%>
[解决办法]
适合....
[解决办法]
其实,二楼已经不错的了。只是写成函数而已。
[解决办法]

探讨

谢谢楼上, 我说的是自己写函数 你用的instr函数我也知道, 自己写的函数有吗

热点排行