Console.WriteLine("查询ArrayList\r\n"); ArrayList alist = new ArrayList(); alist.Add("say"); alist.Add(123); alist.Add("hear"); alist.Add("look"); //指定过滤类型 ofType<数据类型>() var childarr = from st in alist.OfType<int>() select st; foreach (var item in childarr) { Console.WriteLine(item); }
转载于:https://www.cnblogs.com/Sky-cloudless/archive/2012/04/24/2467940.html