Answers for "c# read last 10 lines of file"

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 "c# read last 10 lines of file"

C# Answers by Framework

Browse Popular Code Answers by Language