Created
April 2, 2015 12:54
-
-
Save dsimunic/afc417fb7f7226988e52 to your computer and use it in GitHub Desktop.
Read rows from a multi-line string
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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