X
HOME HTML CSS JAVASCRIPT SQL PHP JQUERY ANGULAR XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

ASP Exists Method


Dictionary Object Reference 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!


Dictionary Object Reference Complete Dictionary Object Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB HOSTING

UK Reseller Hosting

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates FREE Website Templates Free HTML Templates

SHARE THIS PAGE

facebook