How read a file into a seq of lines in F#

后端 未结 6 1862
深忆病人
深忆病人 2020-12-12 20:21

This is C# version:

public static IEnumerable ReadLinesEnumerable(string path) {
  using ( var reader = new StreamReader(path) ) {
    var line         


        
6条回答
  •  轻奢々
    轻奢々 (楼主)
    2020-12-12 20:57

    If you're using .NET 4.0, you can just use File.ReadLines.

    > let readLines filePath = System.IO.File.ReadLines(filePath);;
    
    val readLines : string -> seq
    

提交回复
热议问题