検索結果
先頭5件
-
IO
# readline(limit) -> String (18130.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_... -
IO
# readline(limit , chomp: false) -> String (18130.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_... -
IO
# readline(rs = $ / ) -> String (18130.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_... -
IO
# readline(rs = $ / , chomp: false) -> String (18130.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_... -
IO
# readline(rs , limit) -> String (18130.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_... -
IO
# readline(rs , limit , chomp: false) -> String (18130.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...み用にオープンされていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_... -
IO
# readlines(limit , chomp: false) -> [String] (6133.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...rite("testfile", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines } # => ["line1,\n", "line2,\n", "line3,\n"]
File.open("testfile") { |f| p f.readlines(3) } # => ["lin", "e1,", "\n", "lin", "e2,", "\n", "lin", "e3,", "\n"]
File.open("testfile") { |f| p f.readlines(",") }......例: rsを取り除く(chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
File.open("testfile") { |f| p f.readlines(chomp: true) } # => ["line1,\rline2,", "line3,"]
File.open("testfile") { |f| p f.readlines("\r", chomp: true) } # => ["line1,", "line2,", "\nline3,\n"]... -
IO
# readlines(rs = $ / , chomp: false) -> [String] (6133.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...rite("testfile", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines } # => ["line1,\n", "line2,\n", "line3,\n"]
File.open("testfile") { |f| p f.readlines(3) } # => ["lin", "e1,", "\n", "lin", "e2,", "\n", "lin", "e3,", "\n"]
File.open("testfile") { |f| p f.readlines(",") }......例: rsを取り除く(chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
File.open("testfile") { |f| p f.readlines(chomp: true) } # => ["line1,\rline2,", "line3,"]
File.open("testfile") { |f| p f.readlines("\r", chomp: true) } # => ["line1,", "line2,", "\nline3,\n"]... -
IO
# readlines(rs , limit , chomp: false) -> [String] (6133.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...rite("testfile", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines } # => ["line1,\n", "line2,\n", "line3,\n"]
File.open("testfile") { |f| p f.readlines(3) } # => ["lin", "e1,", "\n", "lin", "e2,", "\n", "lin", "e3,", "\n"]
File.open("testfile") { |f| p f.readlines(",") }......例: rsを取り除く(chomp = true)][ruby]{
IO.write("testfile", "line1,\rline2,\r\nline3,\n")
File.open("testfile") { |f| p f.readlines(chomp: true) } # => ["line1,\rline2,", "line3,"]
File.open("testfile") { |f| p f.readlines("\r", chomp: true) } # => ["line1,", "line2,", "\nline3,\n"]... -
IO
# readlines(limit) -> [String] (6121.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...rite("testfile", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines } # => ["line1,\n", "line2,\n", "line3,\n"]
File.open("testfile") { |f| p f.readlines(3) } # => ["lin", "e1,", "\n", "lin", "e2,", "\n", "lin", "e3,", "\n"]
File.open("testfile") { |f| p f.readlines(",") }... -
IO
# readlines(rs = $ / ) -> [String] (6121.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...rite("testfile", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines } # => ["line1,\n", "line2,\n", "line3,\n"]
File.open("testfile") { |f| p f.readlines(3) } # => ["lin", "e1,", "\n", "lin", "e2,", "\n", "lin", "e3,", "\n"]
File.open("testfile") { |f| p f.readlines(",") }... -
IO
# readlines(rs , limit) -> [String] (6121.0) -
データを全て読み込んで、その各行を要素としてもつ配列を返します。 既に EOF に達していれば空配列 [] を返します。
...rite("testfile", "line1,\nline2,\nline3,\n")
File.open("testfile") { |f| p f.readlines } # => ["line1,\n", "line2,\n", "line3,\n"]
File.open("testfile") { |f| p f.readlines(3) } # => ["lin", "e1,", "\n", "lin", "e2,", "\n", "lin", "e3,", "\n"]
File.open("testfile") { |f| p f.readlines(",") }... -
IO
# gets(limit) -> String | nil (27.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイルのエ......ていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO#readline... -
IO
# gets(limit , chomp: false) -> String | nil (27.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイルのエ......ていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO#readline... -
IO
# gets(rs = $ / ) -> String | nil (27.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイルのエ......ていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO#readline... -
IO
# gets(rs = $ / , chomp: false) -> String | nil (27.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイルのエ......ていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO#readline... -
IO
# gets(rs , limit) -> String | nil (27.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイルのエ......ていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO#readline... -
IO
# gets(rs , limit , chomp: false) -> String | nil (27.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には nil を返します。
...します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。
IO#readline との違いは EOF での振る舞いのみです。
limit で最大の読み込みバイト数を指定します。ただし
ファイルのエ......ていなければ発生します。
f = File.new("oneline_file")
f.gets #=> "This is line one\n"
$_ #=> "This is line one\n"
f.gets #=> nil
$_ #=> nil
@see $/, IO#readline...