ASP问题上的小问题

来源:百度知道 编辑:UC知道 时间:2024/05/28 20:08:08
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>

<%
Dim aaa
aaa="我啊啊啊是"
if instr(aaa,"我")>0 then
response.write "有我啊"
else
response.write "没有我字"
end if
%>
————————————————————这个可以用
但是只能检测当中有没有“我”字,现在我想要检测aaa中有没有多个字,比如还有没有"啊"这个怎么实现。

Function ChkWords(fString)
Dim Words,bwords,i
Words = "这里是要检测的词语|竖线分隔"
If Not(IsNull(Words) or IsNull(fString)) Then
bwords = Split(Words, "|")
For i = 0 to UBound(bwords)
If instr(fString, bwords(i), string(Len(bwords(i)))>0 Then
response.write "有我啊"
else
response.write "没有我字"
end if
Next
End If
ChkWords = fString
End Function