ArrayList.ToArray()


ArrayList   tmp   =   new   ArrayList(); 

tmp.Add(111); 
tmp.Add(2222); 

int[]   tmpint   =   (int[])tmp.ToArray(System.Type.GetType( "System.Int32 ")); 

ArrayList转换为整型数组

ArrayList ArrHouseID = new ArrayList();
string strArrHouseID = string.Empty;
strArrHouseID = String.Join(",", (string[])ArrHouseID.ToArray(Type.GetType("System.String")));
        

ArrayList转换为字符串数组,然后再拼接成字符串。

你可能感兴趣的:(ArrayList.ToArray())