Exists

收藏:0   阅读:22

ASP Exists 方法


Exists 方法返回一个布尔值,该布尔值指示在 Dictionary 对象中是否存在指定的 key。如果存在,返回 true,否则返回 false。

语法

DictionaryObject.Exists(key)

参数 描述
key 必需的。要搜索的 key 值。

实例

<%
dim d
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "n","Norway"
d.Add "i","Italy"
d.Add "s","Sweden"

if d.Exists("n")=true then
response.Write("Key exists!")
else
response.Write("Key does not exist!")
end if

set d=nothing
%>

输出:

Key exists!
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!