一个检测一个字符串在另一个字符串当中出现几次的函数
发表于:2007-06-30来源:作者:点击数:
标签:
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://www.ltesting.net