3件ヒット
[1-3件を表示]
(0.032秒)
別のキーワード
ライブラリ
- ビルトイン (3)
検索結果
先頭3件
-
IO
. readlines(path , limit , chomp: false , opts={}) -> [String] (81496.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...emlist[例][ruby]{
IO.write("testfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}
//emlist[例: rs を取り除く(chomp = true)][ruby]{
IO.write("testfile",......"line1,\rline2,\r\nline3,\n")
IO.readlines("testfile", chomp: true) # => ["line1,\rline2,", "line3,"]
IO.readlines("testfile", "\r", chomp: true) # => ["line1,", "line2,", "\nline3,\n"]
//}... -
IO
. readlines(path , rs = $ / , chomp: false , opts={}) -> [String] (81496.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...emlist[例][ruby]{
IO.write("testfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}
//emlist[例: rs を取り除く(chomp = true)][ruby]{
IO.write("testfile",......"line1,\rline2,\r\nline3,\n")
IO.readlines("testfile", chomp: true) # => ["line1,\rline2,", "line3,"]
IO.readlines("testfile", "\r", chomp: true) # => ["line1,", "line2,", "\nline3,\n"]
//}... -
IO
. readlines(path , rs , limit , chomp: false , opts={}) -> [String] (81496.0) -
path で指定されたファイルを全て読み込んで、その各行を要素としてもつ配列を返します。
...emlist[例][ruby]{
IO.write("testfile", "line1\nline2,\nline3\n")
IO.readlines("testfile") # => ["line1\n", "line2,\n", "line3\n"]
IO.readlines("testfile", ",") # => ["line1\nline2,", "\nline3\n"]
//}
//emlist[例: rs を取り除く(chomp = true)][ruby]{
IO.write("testfile",......"line1,\rline2,\r\nline3,\n")
IO.readlines("testfile", chomp: true) # => ["line1,\rline2,", "line3,"]
IO.readlines("testfile", "\r", chomp: true) # => ["line1,", "line2,", "\nline3,\n"]
//}...