【Asp】Asp判断字符在字符串中重复次数

admin 2021年4月3日19:03:13评论118 views字数 681阅读2分16秒阅读模式

Asp判断字符在字符串中重复次数:

function getCount(express,defaultValue) 
count=0 
temp=split(express,",") '分隔符
for i=0 to ubound(temp) 
if temp=defaultValue then count=count+1 
next 
getCount=count 
end function 
response.write getCount("1,2,3,1,2,1,1,1","2") '字符串,查找字符
%>

Function getCount(s,subs) 
temp = s 
count= 0 
while(instr(s,subs)>0) 
response.write s & "

count = count + 1 
s = right(s,len(s) - instr(s,subs)) 
Wend 
getCount = count 
End Function 
s = "我们建议这样做好,他们不建议这样做!怎么办?" 
subs="建议" 
response.write getCount(s,subs) 
%>

文章来源于lcx.cc:【Asp】Asp判断字符在字符串中重复次数

相关推荐: 服务器流量异常追踪--抵抗AWVS扫描

服务器流量异常追踪--抵抗AWVS扫描 xiaoL | 2013-11-06 02:55 上次发帖求教服务器流量异常处理,看了日志之后发现一坨扫描器留下的痕迹。 发现了WVS的扫描记录,小小的日志文件都被撑成几G大了...(服务器框架定义404页面,导致不存在…

  • 左青龙
  • 微信扫一扫
  • weinxin
  • 右白虎
  • 微信扫一扫
  • weinxin
admin
  • 本文由 发表于 2021年4月3日19:03:13
  • 转载请保留本文链接(CN-SEC中文网:感谢原作者辛苦付出):
                   【Asp】Asp判断字符在字符串中重复次数http://cn-sec.com/archives/319729.html

发表评论

匿名网友 填写信息