最新下载
热门教程
- 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
相关文章
- 烽烟手游新手怎么玩 新手入门玩法详细攻略 03-25
- 《暗区突围》S17赛季诡雾山谷即将来袭 03-25
- 流行的手机飞机游戏排行榜前十名 免费的飞机游戏盘点2026 03-25
- 《草图大师》调颜色教程 03-25
- 爱探险的朵拉游戏下载推荐 经典的朵拉游戏排行2026 03-25
- 有趣的4x4越野游戏手机版下载 好玩的越野车游戏合集2026 03-25