ASP Exists 方法
❮ 完整 Dictionary 物件參考
Exists 方法返回一個布林值,該值指示 Dictionary 物件中是否存在指定的鍵。如果鍵存在,則返回 true,否則返回 false。
語法
DictionaryObject.Exists(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("鍵存在!")
else
Response.Write("鍵不存在!")
end if
set d=nothing
%>
輸出
鍵存在!
❮ 完整 Dictionary 物件參考