最新下载
热门教程
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
一个检测一个字符串在另一个字符串当中出现几次的函数。
时间:2008-01-12 编辑:简简单单 来源:一聚教程网
$http://u2bbs.126.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
-
下一个: 一个实现任意改变计数器位数的函数。
相关文章
- C语言常用的字符串函数整理 05-21
- C中一些常用的字符串hash函数 08-08
- java indexOf() lastIndexOf() 字符串查找函数 05-10
- 关于字符串的一些函数 04-26
- 函数整理(字符串函数) 01-18
- 有用的字符串函数 01-12