第1个回答 2013-06-07
简单
string Result=new string();
SteamReader rd1 =new StreamReader(“1.txt”);
string str1=rd.ReadLine();
string[] OneStr=str1.trim().split(',');
SteamReader rd2 =new StreamReader(“2.txt”);
string str2=rd.ReadLine();
string[] TwoStr=str1.trim().split(',');
for (int i=0;i<OneStr.length;i++)
{
for (int j=0;j<TwoStr.length;j++)
{
int isHave=0;
string[] Detail=TwoStr.split(' ');
if (Detail[0]==OneStr[i])
{
isHave=1;
}
if (isHave==0)
{
if (Result.count<=0)
{
Result+=TwoStr[j];
}
else
{
Result+=","+TwoStr[j];
}
}
}
}
最後得到字符串Result本回答被提问者和网友采纳