Hashtable.Remove 移除

function Remove (key : object) : void

Description描述

Removes the element with the specified key from the Hashtable.

从哈希表中移除指定键的元素。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	public Hashtable h;
	public void Awake() {
		h = new Hashtable();
		h.Add("1", "one");
		h.Add("2", "two");
		h.Remove("1");
		Debug.Log(h.Count);
	}
}
// Creates a Hashtable with two values and removes one
//创建一个具有2个值的哈希表并移除一个

var h : Hashtable;
h = new Hashtable();
h.Add("1","one");
h.Add("2","two");
h.Remove("1");
Debug.Log(h.Count)
Page last updated: 2011-3-10