0
我要得到相同的结果,使用此代码删除为文本文档重复了:加载到列表或上舞台后如何删除从列表C#重复
File.WriteAllLines(@"doc.txt", lines.Select(line1 => line1.Trim()).Distinct().ToArray());
同为大内容列表加载但不能从处理的文件:
List<string> contentList = new List<string>();
阅读内容我使用这种方式:
for (int i = 0; i < contentList.Count; i++)
{
textBox8.AppendText(contentList[i] + "\n");
}
和装载阶段也是循环字符串中的字符串:
contentList.Add(inputStr);
期望的结果是避免重复,如果我走进去重复:
one
two
three
four
two
five
six
three
理想的结果应该是:
one
two
three
four
five
six
确实非常有用 – nikorio