数组类型转换

string数组转int数组

fileIds = fileIds.TrimStart(',');
            string[] fids = fileIds.Split(',');

            //int[] fidcnt = new int[fids.Length];
            //for (int i = 0; i < fids.Length; i++)
            //    fidcnt[i] = int.Parse(fids[i]);

            int[] fidcnt = Array.ConvertAll<string, int>(fids, s => int.Parse(s));

 

posted @ 2017-06-12 11:54  chy710  阅读(6)  评论(0)    收藏  举报