删除List<string>中重复的值
public void getList()
{
List<string> outPut=new List<string>();
outPut.Add("ad");
outPut.Add("ac");
outPut.Add("aa");
outPut.Add("ac");
for (int i = 0; i < outPut.Count; i++)
{
for (int j = i + 1; j < outPut.Count; j++)
{
if (outPut[i].ToString().Equals(outPut[j].ToString()))
{
outPut.Remove(outPut[j].ToString());
}
}
}
foreach (string str in outPut)
{
Response.Write(str.ToString()+",");
}
}