วิธีการ Remove ของ ASP
คำนำออกและการใช้งาน
วิธีการ Remove มีความหมายคือลบ key/item ที่กำหนดใน DictionaryObject
รูปแบบการใช้งาน:
DictionaryObject.Remove(key)
ตัวแปร | รายละเอียด |
---|---|
key | สำคัญต้องมีความเกี่ยวข้องกับ key/item ที่ต้องการลบ |
ตัวอย่าง
<% dim d,a,i set d=Server.CreateObject("Scripting.Dictionary") d.Add "c","China" d.Add "i","Italy" d.Add "s","Sweden" d.Remove("s") 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 %>
การแสดงผล:
ค่าทางประกาศ: c i