ASP Existsメソッド


Dictionary 对象参考手册完全な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("Key exists!")
else
  Response.Write("Key does not exist!")
end if

set d=nothing
%>

出力:

Key exists!


Dictionary 对象参考手册完全なDictionaryオブジェクトリファレンスマニュアル その他の拡張機能