System.Collections.ArrayList hkArray=new System.Collections.ArrayList();//定义一个集合
string [] oldstr=new string [6];
oldstr[0]="you";
oldstr[1]="me";
oldstr[2]="they";
oldstr[3]="you";
oldstr[4]="he";
oldstr[5]="me";
string newstr=null;
int n=oldstr.Length;
for(int i=0;i<n;i++)
{
if(!hkArray.Contains(oldstr[i]))
{
hkArray.Add(oldstr[i]);
newstr=newstr+oldstr[i]+" ";
}
}
MessageBox.Show(newstr);