安大互联
财经热点 > Asp编程 > 用划界字符列表来得到字符所在串的位置(ListFind函数)
【问题文章】用划界字符列表来得到字符所在串的位置(ListFind函数)
浏览次数:【723】  发布日期:2009-8-13 12:09:22    文章分类:Asp编程   
专题:问题文章】 【
 


<%
' Company: Sabra Inc
' Author: Dave Hoffenberg
' Function: Finds a value within a delimited list
' Freeware

Function ListFind(value,list,delim)

If list <> "" Then

arr = split(list,delim)

For i=0 to ubound(arr)

If arr(i) = value Then
Match = 1
Exit For
Else
Match = 0
End If

Next

ListFind = Match

Else

ListFind = 0

End If

End Function

strList = "1,2,3"
response.write ListFind("1",strList,",")

response.write "<br>"

strList = "a-b-c"
response.write ListFind("a",strList,"-")
%>


手机扫码浏览该文章
 ● 相关资讯推荐
 ● 相关资讯专题
  • 网络建设业务咨询

   TEl:13626712526