ASP Exists 方法
定义和用法
Exists 方法返回在 Dictionary 对象中是否存在指定的 key 的布尔值。如果存在,返回 true,否则返回 false。
语法:
DictionaryObject.Exists(key)
| 参数 | 描述 |
|---|---|
| key | 必需的。需搜索的 key 值。 |
实例
<%dim dset d=Server.CreateObject("Scripting.Dictionary")d.Add "c","China"d.Add "i","Italy"d.Add "s","Sweden"if d.Exists("c")=true thenResponse.Write("键存在!")elseResponse.Write("键不存在!")end ifset d=nothing%>
输出:
键存在!