The example from this post has an example
open System.IO
let lines =
File.ReadAllLines("tclscript.do")
|> Seq.map (fun line ->
let newLine = line.Replace("{", "{{").Replace("}", "}}")
newLine )
File.WriteAllLines("tclscript.txt", lines)
that gives an error when compilation.
error FS0001: This expression was expected to have type
string []
but here has type
seq<string>
How to convert seq to string[] to remove this error message?
Building on Jaime’s answer, since
ReadAllLines()returns an array, just useArray.mapinstead ofSeq.map