Answer the question
In order to leave comments, you need to log in
How to delete identical lines in a file, while leaving one of them?
How to delete identical lines in a file, while leaving one of them? Thanks in advance
Answer the question
In order to leave comments, you need to log in
var lines = File.ReadAllLines(pathToFile);
var disctinctLines = lines.Distinct();
File.WriteAllLines(pathToFile, disctinctLines);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question