ASP计算str2在str1中出现的次数
更新时间:2008年05月15日 23:29:59 作者:
可以方便计算一个字符串在另一个字符串出现的次数
function CountStr(str1,str2)
dim tmp,i,j
if str1="" or isnull(str1) then
j=0
elseif str2="" or isnull(str2) then
j=1
else
tmp=split(str1,str2)
j=0
for i=0 to ubound(tmp)
if tmp(i)<>"" then j=j+1
next
end if
countstr=j
end function
dim tmp,i,j
if str1="" or isnull(str1) then
j=0
elseif str2="" or isnull(str2) then
j=1
else
tmp=split(str1,str2)
j=0
for i=0 to ubound(tmp)
if tmp(i)<>"" then j=j+1
next
end if
countstr=j
end function
相关文章
asp连接SQL和Access数据代码(asp里的随机函数)
asp连接SQL和Access数据代码,asp里的随机函数,需要的朋友可以参考下2012-09-09
ASP基础入门第八篇(ASP内建对象Application和Session)
这篇文章主要介绍了ASP内建对象Application和Session的相关资料,需要的朋友可以参考下2015-10-10
asp中回车换行符CHR(10)表示换行,CHR(13)表示回车,CHR(32)表示空格
这篇文章主要介绍了asp中回车换行符CHR(10)表示换行,CHR(13)表示回车,CHR(32)表示空格,需要的朋友可以参考下2006-08-08


最新评论