View Problem

Read the contents of a file into a string

DiskEdit
python
contents = open('myFile.txt', 'rt').read()
ExpandDiskEdit
erlang
Text = readfile("Solution607.erl"),
ExpandDiskEdit
erlang
Text = readfile("Solution608.erl"),
ExpandDiskEdit
fantom
contents := File(`file.text`).readAllStr
DiskEdit
clojure
(slurp "/tmp/foobar")

Submit a new solution for python, erlang, fantom, or clojure
There are 18 other solutions in additional languages (cpp, csharp, fsharp, groovy ...)