Please note, this is a STATIC archive of website www.w3schools.com from 05 May 2020, cach3.com does not collect or store any user information, there is no "phishing" involved.
THE WORLD'S LARGEST WEB DEVELOPER SITE

ASP Exists Method


❮ Complete Dictionary Object Reference

The Exists method returns a Boolean value that indicates whether a specified key exists in the Dictionary object. It returns true if the key exists, and false if not.

Syntax

DictionaryObject.Exists(key)

Parameter Description
key Required. The key value to search for

Example

<%
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
%>

Output:

Key exists!

❮ Complete Dictionary Object Reference