Write file from string in Ruby
Tagged with
Ruby
Language: Ruby
View as text
# write the file from a string
def put_file_from_string(f, s)
File.open(f , 'w') do |file|
file.puts(s)
end
end
Language: Ruby
# write the file from a string
def put_file_from_string(f, s)
File.open(f , 'w') do |file|
file.puts(s)
end
end
SnippetStash costs money to host and develop. The service is free for everyone to use
but if you found it useful please consider making a small donation.