Ruby 读取文件
一次全读出来
textAll = File.read("fileName.txt")
puts textAll
一次读取一行
file = File.open("fileName.txt")
file.each_line {|line|
puts line
}
file.close
以上就是Ruby 读取文件的详细内容,更多关于Ruby 读取文件的资料请关注九品源码其它相关文章!
本站已有295人使用QQ登录你即将成为第296位