c# 数组操作

     数组删除与合并

      string strId = e.Item.Cells[0].Text.ToString();

                string[] arr = ViewData.FileInfo.MeetingIdList.Split(',');
                ArrayList al = new ArrayList(arr);

                for (int i = 0; i < al.Count; i++)
                {
                    if (strId == al[i].ToString())
                    {
                        al.RemoveAt(i);

                    }
                }

                arr = (string[])al.ToArray(typeof(string));

                ViewData.FileInfo.MeetingIdList = string.Join(",", arr);

posted @ 2011-11-15 16:13  星火卓越  阅读(282)  评论(0编辑  收藏  举报