C#之ArrayList

阅读 198

2022-07-18

using System.Collections;

 

新建:

ArrayList list = new ArrayList(); 

 

添加元素:

 

int a = 1;

list.Add(a);

 

遍历:

foreach(int a in list){

Debug.Log(a);

}

 

统计长度:

Debug.Log (list.Count);

 

清空:

list.Clear();

黄世宇/Shiyu Huang's Personal Page:​​https://huangshiyu13.github.io/​​



精彩评论(0)

0 0 举报