#读文件f=File.open("myfile.txt","r")f.each_linedo|line|puts"Ireadthisline:#{line}"endFile.foreach("myfile.txt")do|line|puts"Ireadthisline:#{line}"endf=File.open("myfile.txt","r")line=f.getsputs"ThelineIreadis:#{line}"#写操作File.open('filename','w')do|f|f...
查看全文