c#两个数组对比取出相同的元素输出
string strNew = "";
string m = "朱雅君,姚怡尔,涂静,";
string n = "姚怡尔,涂静,刘刚";
string[] A = m.Split(',');
string[] B = n.Split(',');
//var reNew = (from a in A select a).Intersect(from b in B select b).ToArray();
var reNew = from s in A where B.Contains(s) select s;
foreach (var v in reNew)
{
strNew+=v.ToString()+",";
}
Response.Write(strNew);