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

2018-09-06 13:20

阅读:579

  functionCountStr(str1,str2)
dimtmp,i,j
ifstr1=orisnull(str1)then
j=0
elseifstr2=orisnull(str2)then
j=1
else
tmp=split(str1,str2)
j=0
fori=0toubound(tmp)
iftmp(i)<>thenj=j+1
next
endif
countstr=j
endfunction


评论


亲,登录后才可以留言!