zoukankan      html  css  js  c++  java
  • 数组转换

           //获取ListBox中的要删除的角色
            ArrayList deleteRoleArray = new ArrayList();
            foreach (ListItem item in lst_RestRole.Items)
            {
                string newRoleName = item.Text;
                //判断是否是已经存在的
                foreach (string oldRoleName in oldRoleNames)
                {
                    //如果是已经存在的,那么就放入要删除的ArrayList中
                    if (oldRoleName == newRoleName)
                    {
                        deleteRoleArray.Add(newRoleName);
                        break;
                    }
                }
            }

            //把ArrayList转换成String[]
            string[] addRoleNames = (string[])roleArray.ToArray(typeof(string));

  • 相关阅读:
    bzoj4289
    bzoj3033
    bzoj3144
    896C
    bzoj4430
    bzoj4455
    bzoj5117
    BZOJ 1564: [NOI2009]二叉查找树
    BZOJ1261: [SCOI2006]zh_tree
    BZOJ1090: [SCOI2003]字符串折叠
  • 原文地址:https://www.cnblogs.com/hqbird/p/1500105.html
Copyright © 2011-2022 走看看