ASP Exists 方法

定义和用法

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

语法:

DictionaryObject.Exists(key)
参数 描述
key 必需的。需搜索的 key 值。

实例

<%
dim d
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "c","Myanmar"
d.Add "i","Myanmar"
d.Add "s","Myanmar"
if d.Exists("c")=true then
  Response.Write("Key exists!")
else
  Response.Write("Key does not exist!")
end if
set d=nothing
%>

ထုတ်သွင်းထားသည်:

Key exists!