View Problem

Read the contents of a file into a string

ExpandDiskEdit
fsharp
let file = new FileStream("test.txt", FileMode.Open)
let buffer = new String((new BinaryReader(file)).ReadChars(Convert.ToInt32(file.Length)))
ExpandDiskEdit
fsharp
let stream = new StreamReader("test.txt")
let buffer = stream.ReadToEnd()
ExpandDiskEdit
fsharp
let buffer = File.ReadAllText("test.txt")

Submit a new solution for fsharp
There are 20 other solutions in additional languages (clojure, cpp, csharp, erlang ...)