最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
一个检测一个字符串在另一个字符串当中出现几次的函数。
时间:2022-07-02 23:44:35 编辑:袖梨 来源:一聚教程网
$U2 Forum rautinee原创$
$http://u2bbs.12***6.com$
一个网友问就写了一个,:)
Function CheckTheChar(TheChar,TheString)
'TheChar="要检测的字符串"
'TheString="待检测的字符串"
if inStr(TheString,TheChar) then
for n =1 to Len(TheString)
if Mid(TheString,n,Len(TheChar))=TheChar then
CheckTheChar=CheckTheChar+1
End if
Next
CheckTheChar="这个字符"&CheckTheChar&"次"
else
CheckTheChar="0次"
end if
End Function
'++++++++++++++++
example:
Response.write CheckTheChar("大家","a224大家4a434a4大家654arewr4a4a")
----------------------------------------------------
ok enjoy it and good luck
$http://u2bbs.12***6.com$
一个网友问就写了一个,:)
Function CheckTheChar(TheChar,TheString)
'TheChar="要检测的字符串"
'TheString="待检测的字符串"
if inStr(TheString,TheChar) then
for n =1 to Len(TheString)
if Mid(TheString,n,Len(TheChar))=TheChar then
CheckTheChar=CheckTheChar+1
End if
Next
CheckTheChar="这个字符"&CheckTheChar&"次"
else
CheckTheChar="0次"
end if
End Function
'++++++++++++++++
example:
Response.write CheckTheChar("大家","a224大家4a434a4大家654arewr4a4a")
----------------------------------------------------
ok enjoy it and good luck
相关文章
- 她逃他追法追召唤灵令你插翅难飞! 06-03
- Med-V1以3B参数小模型实现零样本生物医学证据归因 06-03
- 你才是怪物好玩吗 你才是怪物玩法简介 06-03
- 流放之路2 0.5深渊打宝玩法详解 06-03
- ADRA-Bank:评估学术深度研究代理的模块化基准 06-03
- 图吧工具箱如何查看内存品牌 06-03