Answers for "how to read last line of a file in c#"

C#
0

c# read last 10 lines of file

var nrOfPagesToRead = 10;
var lastLines = File.ReadLines(filePath).TakeLast(nrOfPagesToRead);
// careful because ReadLines(path) reads all the file in memory.
// Do not use this for large files.
Posted by: Guest on November-19-2020

Code answers related to "how to read last line of a file in c#"

C# Answers by Framework

Browse Popular Code Answers by Language