Skip to content

格式

typescript
HashSet.count

所属类: HashSet

描述

集合中的元素数。

参数

参数名类型描述

返回值

类型描述
number

代码示例

typescript
let myHashSet  = new HashSet<String>(String);
//添加元素到 myHashSet
myHashSet.Add("apple");
myHashSet.Add("banana");
myHashSet.Add("orange");

let count = myHashSet.count;
Debug.Log("集合中一共有", count, "个元素");