您当前位置:编程帮手 > 知识 > 知识 > C# > 数组 > 内容
代码库
2015-12-07 14:47:34 访问(2426) 赞(0) 踩(0)
/// <summary> /// List<int> 转成 int[] /// </summary> /// <param name="theList"></param> /// <returns></returns> public static int[] ListToIntArray(List<int> theList) { int iCount = theList.Count; int[] theResult = new int[iCount]; for (int i = 0; i < iCount; ++i) { theResult[i] = theList[i]; } return theResult; // .net自带的写法 // // theList.ToArray(); }
上一条:
下一条: