Skip to content

Instantly share code, notes, and snippets.

@dsimunic
Created April 2, 2015 12:54
Show Gist options
  • Save dsimunic/afc417fb7f7226988e52 to your computer and use it in GitHub Desktop.
Save dsimunic/afc417fb7f7226988e52 to your computer and use it in GitHub Desktop.
Read rows from a multi-line string
open System.IO
let splitRows (s:string) =
new StringReader(s)
|> Seq.unfold (fun sr ->
match sr.ReadLine() with
| null -> sr.Dispose(); None
| str -> Some(str, sr))
|> Seq.toArray
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment