数组定义

int a;
int a=new int();

string a;
string a=new string();

string a="1";
string a=new string("1");

StringBuilder MY=new StringBuilder("aaaaaaaaaaa");

------------------------------------------------------------------------------------

数组

string[] a=new string[5]; 
a[0]="bb"; 


int[] a=new int[5]{1,2,3,4,5};

int[,] arr=new int[2,2]{ {1,2},{3,4} }

----------------------------------------------------------------

ArrayList alt =new ArrayList();
alt.Add("ssd");
alt.Add("sdd");
foreach(string interName in alt)
{

}

int[] arr=new int[5]{1,2,3,4,5};
ArrayList List =new ArrayList(arr);

ArrayList List=new ArrayList(5);
 

-------------------------------------------------------------------


List.Insert(3,7);    插入7

List.Clear();          清空

List.Remove(3);   移除3 

List.RemoveAt(3);  移除索引为3

List.RemoveRange(3,2);第三个开始的两个

List.Contains(2) ;判断是否包含2

---------------------------------------------------------------------


Hashtable hashtable = new Hashtable();
hashtable.Add("id","BH0001");


hashtable.Count为1

hashtable.Clear();                清空

hashtable.Count为0

hashtable.Remove("id");        删

hashtable.Contains("id");        包含
hashtable.ContainsValue("BH0001");        包含
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值