网络编程 
首页 > 网络编程 > 浏览文章

ASP计算str2在str1中出现的次数

(编辑:jimmy 日期: 2024/10/9 浏览:3 次 )
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
上一篇:asp采集抓取网上房产信息的代码
下一篇:ASP字符串转换为整形、双精度型、布尔