FUNCTION StrSum(LongStr,ShorStr) 'LongStr为要进行搜索的字符串,ShorStr为要统计的字符串
StrSum = 0 'StrSum存储要统计的字符串出现次数,初值为0
for i = 1 to len(LongStr)
Str = mid(LongStr,i,1) '遍历LongStr
if Str = ShorStr then '如果出现ShorStr,StrSum的值+1
StrSum = StrSum + 1
end if
next
END FUNCTION
'例
a = StrSum("a/b/c/d/e/f","/")
Response.Write a 'a等于5