自强学堂
自强学堂:学习、分享、让你更强!
ASP 实例HTMLCSSJAVASCRIPTJQUERYSQLPHPBOOTSTRAPANGULARXML
 

ASP Exists 方法

Dictionary 对象参考手册 完整的 Dictionary 对象参考手册

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!


Dictionary 对象参考手册 完整的 Dictionary 对象参考手册