string str = "";
            string str2 = "";
            string[] arr2 = { "预约时间", "姓名", "性别", "年龄", "电话", "身份证号码", "诊疗卡号", "订单号", "挂号时间", "科室", "医院", "监护人" };
            string[] arr1 = { "预约时间", "姓名", "性别", "年龄", "电话", "身份证号码", "诊疗卡号", "订单号", "挂号时间", "科室", "医院", "监护人", "行政" };
            for (int A = 0; A < arr1.Length; A++)
            {
                //判断数组arr1中的值是否在arr2中存在
                bool exists = ((IList)arr2).Contains(arr1[A].ToString());
                if (exists)
                {

                }
                else
                {
                    str2 += arr1[A].ToString();
                }
            }
            MessageBox.Show(str2);//弹出的就是arr1中的“行政”

 

 

IList的命名空间是:using System.Collections;


 

posted on 2011-07-01 10:00  张@天  阅读(1340)  评论(0编辑  收藏  举报