asp程序里,如何判断一个字符串中存在包含了另一个字符串?

1.判断是否包含某某字符函数是:Instr()和InstrRev();
2.具体使用如下:
ab="abcdefgHTTP"
你可以用Instr()或者InstrRev()来判断
if Instr(ab, "a")>0 then或
if InstrRev(ab, "a")>0 then

else


3.具体代码如下:
<%
dim ly=request("LY")
if Instr(ly, "HTTP") >0 then
response.write("LY变量是包含了HTTP字符串!即TRUE")
else
response.write("LY变量中没有包含HTTP字符串!即FALSE")
end if
%>

posted @ 2019-05-28 21:09  阿波罗任先生  阅读(3826)  评论(0编辑  收藏  举报