阅读背景:

在Ruby中,你能在一行中创建/写入/附加一个字符串到一个文件吗

来源:互联网 

Is it possible to do this?

有可能做到吗?

v='some text'
w='my' + Time.new.strftime("%m-%d-%Y").to_s + '.txt'
File.write(w,v) # will create file if it doesn't exist and recreates everytime 
v='some 



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: