ASP計(jì)算str2在str1中出現(xiàn)的次數(shù)
更新時(shí)間:2008年05月15日 23:29:59 作者:
可以方便計(jì)算一個(gè)字符串在另一個(gè)字符串出現(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)文章
SQL"不能為新插入的行確定標(biāo)識(shí)"錯(cuò)誤的解決方法
下列代碼運(yùn)行將出錯(cuò)(不能為新插入的行確定標(biāo)識(shí)),即新記錄不能為自己的另一個(gè)字段賦予新生成標(biāo)識(shí)的值2008-10-10Asp Conn.execute的參數(shù)與返回值總結(jié)
這篇文章主要介紹了Asp Conn.execute的參數(shù)與返回值總結(jié),數(shù)據(jù)庫對(duì)象的execute方法參數(shù)與返回值總結(jié),需要的朋友可以參考下2014-07-07asp去除html的函數(shù)代碼分析附實(shí)例說明
asp去除html的函數(shù)代碼分析附實(shí)例說明,經(jīng)腳本之家編程測(cè)試確實(shí)好用。2012-01-01ASP Cookies操作的詳細(xì)介紹與實(shí)例代碼
Request和Response對(duì)象都有一組Cookie。Request.cookie集合是一系列Cookie,從客戶端與HTTP Request一起發(fā)送到Web服務(wù)器。反過來,如果你希望把Cookie發(fā)送到客戶機(jī),就可以使用Response.cookie。2010-03-03ASP去掉字符串頭尾連續(xù)回車和空格的Function
去掉字符串頭尾的連續(xù)的回車和空格 去掉字符串開頭的連續(xù)的回車和空格 去掉字符串末尾的連續(xù)的回車和空格2008-12-12