string[] a1={"1","2"};
string[] a2={"2","3"};
Ilist<string> jiaoji=new List<string>;
Ilist<string> bingji=new List<string>;
//交集
foreach(string s1 in a1)
{
foreach(string s2 in a2)
{
if (s1=s2)
jiaoji.add(s1);
}
}
// 并集
foreach(string s in a1)
{
bingji.add(s);
}
foreach(string s in a2)
{
bingji.add(s);
}
//去掉重复
for(int i=0 ;i<bingji.length;i++)
{
for(int j=i+1;j<bingji.length;j++)
{
if(bingji[i]==bingji[j])
bingji.remove(j);
}
}