Skip to content

ReadLinesFromFile Method ​

Definition ​

  • Namespace: JASE.IO
  • Assembly: JASE.dll

IEnumerable<string> ReadLinesFromFile(string filename) ​

csharp
IEnumerable<string> ReadLinesFromFile(string filename)

Lazily reads a file line-by-line.

Parameters ​

NameDescription
filenameThe path to the file to read.

Returns ​

An IEnumerable1` that yields one line at a time.

Remarks ​

The underlying file is opened once and closed when enumeration completes or the sequence is disposed.