Thursday, February 17, 2011

Ruby Script: Save String To File


Ruby script to save a string to a file.
# Save a string to a file.
myStr = "This is a test"
aFile = File.new("myString.txt", "w")
aFile.write(myStr)
aFile.close

No comments:

Post a Comment