如何判断变量里面是否有对应的值
我想做一个判断,比如变量vwheref的值可能是北京市 或者 北京市朝阳区,或者北京市海淀区。或者上海市等,我想要做的是,如果vwheref的值包含北京,就跳转到一个页面,如果不是北京,就跳转到另外一个页面,谢谢。
[解决办法]
用instr函数
if instr(vwheref,"北京")>0 then'变量中包含北京Response.Redirect("http://www.baidu.com/")elseResponse.Redirect("http://www.google.com")end if
[解决办法]
if instr(vwheref,"北京")>0 then'变量中包含北京
Response.Redirect("http://www.baidu.com/")
else
Response.Redirect("http://www.google.com")
end if