Open In App

ASP Dictionary.Keys Method

Improve
Improve
Like Article
Like
Save
Share
Report

The ASP Dictionary.Keys Method is used for returning an array of all the keys in a Dictionary Object. 

Syntax:

DictionaryObject.Keys

Example Code: Below code demonstrates the ASP Keys Method. 

ASP




<%
dim d,a,i
set d=Server.CreateObject("Scripting.Dictionary")
d.Add "m","mango"
d.Add "e","Elephant"
d.Add "n","Nagaland"
  
Response.Write("
<p>Key values:</p>
")
a=d.Keys
for i=0 to d.Count-1
  Response.Write(a(i))
  Response.Write("<br>")
next
  
set d=nothing
%>


Output:

Key values:

m
e
n

Last Updated : 31 Mar, 2021
Like Article
Save Article
Previous
Next
Share your thoughts in the comments
Similar Reads