ASP計算str2在str1中出現(xiàn)的次數(shù)
更新時間:2008年05月15日 23:29:59 作者:
可以方便計算一個字符串在另一個字符串出現(xiàn)的次數(shù)
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
相關(guān)文章
Asp Conn.execute的參數(shù)與返回值總結(jié)
這篇文章主要介紹了Asp Conn.execute的參數(shù)與返回值總結(jié),數(shù)據(jù)庫對象的execute方法參數(shù)與返回值總結(jié),需要的朋友可以參考下2014-07-07ASP去掉字符串頭尾連續(xù)回車和空格的Function
去掉字符串頭尾的連續(xù)的回車和空格 去掉字符串開頭的連續(xù)的回車和空格 去掉字符串末尾的連續(xù)的回車和空格2008-12-12