Posted By

webonomic on 01/10/10


Tagged

file String save


Versions (?)

Ruby script to save a string to a file.


 / Published in: Ruby
 

  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  

You need to login to post a comment.