Check out example codes for "c# counting lines". It will help you in understanding the concepts better.

Code Example 1

public long CountLinesLINQ(FileInfo file)  
    => File.ReadLines(file.FullName).Count();

Learn ReactJs, React Native from akashmittal.com