Ruby script to save a string to a file.


/ Published in: Ruby
Save to your folder(s)



Copy this code and paste it in your HTML
  1. # Save a string to a file.
  2. myStr = "This is a test"
  3. aFile = File.new("myString.txt", "w")
  4. aFile.write(myStr)
  5. aFile.close

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.