ライブラリ
- ビルトイン (348)
-
irb
/ input-method (12) - rake (12)
- tempfile (36)
- zlib (24)
クラス
-
ARGF
. class (24) - IO (324)
-
IRB
:: FileInputMethod (12) - Tempfile (36)
-
Zlib
:: GzipReader (24)
モジュール
- Kernel (12)
検索結果
先頭5件
-
IO
# each(rs , limit , chomp: false) -> Enumerator (25.0) -
IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。
...ンされていなければ発生します。
//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\......区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so on...")
f = File.new("testfile")
f.each(",", 10) { |line| p "#{f.lineno}: #{line}" }
# => "0: This is li"
# "1: ne one,"
# "1: This i......uby]{
IO.write("testfile", "This is line one\nThis is line two\nThis is line three\nAnd so on...")
f = File.new("testfile")
f.each(chomp: true) { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one"
# "2: This is line two"
# "3: This is line three"
# "4: And so on..."
//}
@see $/, IO#gets... -
IO
# each(rs , limit , chomp: false) {|line| . . . } -> self (25.0) -
IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。
...ンされていなければ発生します。
//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\......区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so on...")
f = File.new("testfile")
f.each(",", 10) { |line| p "#{f.lineno}: #{line}" }
# => "0: This is li"
# "1: ne one,"
# "1: This i......uby]{
IO.write("testfile", "This is line one\nThis is line two\nThis is line three\nAnd so on...")
f = File.new("testfile")
f.each(chomp: true) { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one"
# "2: This is line two"
# "3: This is line three"
# "4: And so on..."
//}
@see $/, IO#gets... -
IO
# each _ line(limit , chomp: false) -> Enumerator (25.0) -
IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。
...ンされていなければ発生します。
//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\......区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so on...")
f = File.new("testfile")
f.each(",", 10) { |line| p "#{f.lineno}: #{line}" }
# => "0: This is li"
# "1: ne one,"
# "1: This i......uby]{
IO.write("testfile", "This is line one\nThis is line two\nThis is line three\nAnd so on...")
f = File.new("testfile")
f.each(chomp: true) { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one"
# "2: This is line two"
# "3: This is line three"
# "4: And so on..."
//}
@see $/, IO#gets... -
IO
# each _ line(limit , chomp: false) {|line| . . . } -> self (25.0) -
IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。
...ンされていなければ発生します。
//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\......区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so on...")
f = File.new("testfile")
f.each(",", 10) { |line| p "#{f.lineno}: #{line}" }
# => "0: This is li"
# "1: ne one,"
# "1: This i......uby]{
IO.write("testfile", "This is line one\nThis is line two\nThis is line three\nAnd so on...")
f = File.new("testfile")
f.each(chomp: true) { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one"
# "2: This is line two"
# "3: This is line three"
# "4: And so on..."
//}
@see $/, IO#gets... -
IO
# each _ line(rs = $ / , chomp: false) -> Enumerator (25.0) -
IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。
...ンされていなければ発生します。
//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\......区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so on...")
f = File.new("testfile")
f.each(",", 10) { |line| p "#{f.lineno}: #{line}" }
# => "0: This is li"
# "1: ne one,"
# "1: This i......uby]{
IO.write("testfile", "This is line one\nThis is line two\nThis is line three\nAnd so on...")
f = File.new("testfile")
f.each(chomp: true) { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one"
# "2: This is line two"
# "3: This is line three"
# "4: And so on..."
//}
@see $/, IO#gets... -
IO
# each _ line(rs = $ / , chomp: false) {|line| . . . } -> self (25.0) -
IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。
...ンされていなければ発生します。
//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\......区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so on...")
f = File.new("testfile")
f.each(",", 10) { |line| p "#{f.lineno}: #{line}" }
# => "0: This is li"
# "1: ne one,"
# "1: This i......uby]{
IO.write("testfile", "This is line one\nThis is line two\nThis is line three\nAnd so on...")
f = File.new("testfile")
f.each(chomp: true) { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one"
# "2: This is line two"
# "3: This is line three"
# "4: And so on..."
//}
@see $/, IO#gets... -
IO
# each _ line(rs , limit , chomp: false) -> Enumerator (25.0) -
IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。
...ンされていなければ発生します。
//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\......区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so on...")
f = File.new("testfile")
f.each(",", 10) { |line| p "#{f.lineno}: #{line}" }
# => "0: This is li"
# "1: ne one,"
# "1: This i......uby]{
IO.write("testfile", "This is line one\nThis is line two\nThis is line three\nAnd so on...")
f = File.new("testfile")
f.each(chomp: true) { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one"
# "2: This is line two"
# "3: This is line three"
# "4: And so on..."
//}
@see $/, IO#gets... -
IO
# each _ line(rs , limit , chomp: false) {|line| . . . } -> self (25.0) -
IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。
...ンされていなければ発生します。
//emlist[例: 引数なし][ruby]{
IO.write("testfile", "This is line one,\nThis is line two,\nThis is line three,\nAnd so on...")
f = File.new("testfile")
f.each { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one,\n"
# "2: This is line two,\......区切りに半角カンマ、最大読み取りバイト数に 10 を指定][ruby]{
IO.write("testfile", "This is line one,This is line two,This is line three,And so on...")
f = File.new("testfile")
f.each(",", 10) { |line| p "#{f.lineno}: #{line}" }
# => "0: This is li"
# "1: ne one,"
# "1: This i......uby]{
IO.write("testfile", "This is line one\nThis is line two\nThis is line three\nAnd so on...")
f = File.new("testfile")
f.each(chomp: true) { |line| p "#{f.lineno}: #{line}" }
# => "1: This is line one"
# "2: This is line two"
# "3: This is line three"
# "4: And so on..."
//}
@see $/, IO#gets... -
IO
# readline(limit) -> String (25.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...生します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。IO#gets との違いは EOF での振る舞いのみです。
limit で最大読み込みバイト数を指定します。ただしマルチバイト文字......ていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_ #=> nil
@see $/, IO#gets... -
IO
# readline(limit , chomp: false) -> String (25.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...生します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。IO#gets との違いは EOF での振る舞いのみです。
limit で最大読み込みバイト数を指定します。ただしマルチバイト文字......ていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_ #=> nil
@see $/, IO#gets... -
IO
# readline(rs = $ / ) -> String (25.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...生します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。IO#gets との違いは EOF での振る舞いのみです。
limit で最大読み込みバイト数を指定します。ただしマルチバイト文字......ていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_ #=> nil
@see $/, IO#gets... -
IO
# readline(rs = $ / , chomp: false) -> String (25.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...生します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。IO#gets との違いは EOF での振る舞いのみです。
limit で最大読み込みバイト数を指定します。ただしマルチバイト文字......ていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_ #=> nil
@see $/, IO#gets... -
IO
# readline(rs , limit) -> String (25.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...生します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。IO#gets との違いは EOF での振る舞いのみです。
limit で最大読み込みバイト数を指定します。ただしマルチバイト文字......ていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_ #=> nil
@see $/, IO#gets... -
IO
# readline(rs , limit , chomp: false) -> String (25.0) -
一行読み込んで、読み込みに成功した時にはその文字列を返します。 EOF に到達した時には EOFError が発生します。
...生します。
テキスト読み込みメソッドとして動作します。
読み込んだ文字列を変数 $_ にセットします。IO#gets との違いは EOF での振る舞いのみです。
limit で最大読み込みバイト数を指定します。ただしマルチバイト文字......ていなければ発生します。
f = File.new("oneline_file")
f.readline #=> "This is line one\n"
$_ #=> "This is line one\n"
f.readline #=> EOFError
$_ #=> nil
@see $/, IO#gets...