Login
|
Signup
langref.org
-
ruby
,
csharp
,
fantom
, and
clojure
add..
all
cpp
erlang
fsharp
go
groovy
haskell
java
ocaml
perl
php
python
scala
Home
All
Solved
Unsolved
Strings
Numbers
Regex
Lists
Maps
Structure
Files
Dates
OOP
Networking
XML
Algorithms
Misc
Parallel
View Problem
Files
Writing
Write a string to a file
ruby
File.new("a_file", "w") << "some text"
File.new("a_file", "w") << "some text"
csharp
System.IO.File.WriteAllText("filename.txt", "Some text to write to the file");
System.IO.File.WriteAllText("filename.txt", "Some text to write to the file");
fantom
File(`out.txt`).out.writeChars("some text").flush
class SolutionXX
{
Void main()
{
File(`out.txt`).out.writeChars("some text").flush
}
}
clojure
(with-out-writer "output.txt" (println "Hello file!"))
(use '[clojure.contrib.duck-streams :only (with-out-writer)])
(with-out-writer "output.txt" (println "Hello file!"))
Submit a new solution for
ruby
,
csharp
,
fantom
, or
clojure
There are 15 other solutions in
additional
languages (
cpp
,
erlang
,
fsharp
,
groovy
...)