るりまサーチ

最速Rubyリファレンスマニュアル検索!
155件ヒット [1-100件を表示] (0.039秒)

別のキーワード

  1. _builtin each_line
  2. io each_line
  3. tracer set_get_line_procs
  4. pathname each_line
  5. stringio each_line

ライブラリ

クラス

  • IO (132)

キーワード

検索結果

<< 1 2 > >>

IO#each_line(limit) -> Enumerator (15112.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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 is li"
# "2: ne two,"
# "2: This is li"
# "3: ne three,"
# "3: And so on."
# "4: .."
//}

@see $/, IO#gets...

IO#each_line(limit) {|line| ... } -> self (15112.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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 is li"
# "2: ne two,"
# "2: This is li"
# "3: ne three,"
# "3: And so on."
# "4: .."
//}

@see $/, IO#gets...

IO#each_line(limit, chomp: false) -> Enumerator (15112.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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 (15112.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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 = $/) -> Enumerator (15112.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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 is li"
# "2: ne two,"
# "2: This is li"
# "3: ne three,"
# "3: And so on."
# "4: .."
//}

@see $/, IO#gets...

絞り込み条件を変える

IO#each_line(rs = $/) {|line| ... } -> self (15112.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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 is li"
# "2: ne two,"
# "2: This is li"
# "3: ne three,"
# "3: And so on."
# "4: .."
//}

@see $/, IO#gets...

IO#each_line(rs = $/, chomp: false) -> Enumerator (15112.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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 (15112.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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) -> Enumerator (15112.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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 is li"
# "2: ne two,"
# "2: This is li"
# "3: ne three,"
# "3: And so on."
# "4: .."
//}

@see $/, IO#gets...

IO#each_line(rs, limit) {|line| ... } -> self (15112.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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 is li"
# "2: ne two,"
# "2: This is li"
# "3: ne three,"
# "3: And so on."
# "4: .."
//}

@see $/, IO#gets...

絞り込み条件を変える

IO#each_line(rs, limit, chomp: false) -> Enumerator (15112.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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 (15112.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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...

NEWS for Ruby 2.4.0 (24.0)

NEWS for Ruby 2.4.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...け付けるようになりました。
half には :even, :up, :down が指定可能です。 12548 12958 12953

* IO
* IO#gets, IO#readline, IO#each_line, IO#readlines, IO.foreach は
chomp というキーワード引数を受け付けるようになりました。12553

* Kern...
...String#casecmp? を追加 12786
* String#concat, String#prepend 複数の引数を受け付けるようになりました 12333
* String#each_line, String#lines 省略可能なキーワード引数 chomp を受け付けるようになりました 12553
* String#match? を追加 12898...
...ます。
Variations are available with options. 10085
* String.new(capacity: size) 12024

* StringIO
* StringIO#gets, StringIO#readline, StringIO#each_line, StringIO#readlines
省略可能なキーワード引数 chomp を受け付けるようになりました 12553

* Symb...

IO (18.0)

基本的な入出力機能のためのクラスです。

...io_encoding」を参照して下さい。
以下がテキスト読み込みメソッドです。

* IO.foreach
* IO.readlines
* IO#each_line
* IO#lines
* IO#gets
* IO#getc
* IO#ungetc
* IO#read
* IO#readchar
* IO#readline
* IO#readlines

バイナリ読み込みメソッドは IO のエ...
...//emlist{
メソッド 既にEOFだったら

IO#each_byte 何もしない
IO#getc nil
IO#gets
nil
IO#read() ""
IO#read(length) nil
IO#read_nonblock EOFError
IO#readchar...
...は「io_encoding」を参照して下さい。
以下がテキスト読み込みメソッドです。

* IO.foreach
* IO.readlines
* IO#each_line
* IO#gets
* IO#getc
* IO#ungetc
* IO#read
* IO#readchar
* IO#readline
* IO#readlines

バイナリ読み込みメソッドは IO のエンコ...

IO#each(limit) -> Enumerator (12.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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 is li"
# "2: ne two,"
# "2: This is li"
# "3: ne three,"
# "3: And so on."
# "4: .."
//}

@see $/, IO#gets...

絞り込み条件を変える

IO#each(limit) {|line| ... } -> self (12.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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 is li"
# "2: ne two,"
# "2: This is li"
# "3: ne three,"
# "3: And so on."
# "4: .."
//}

@see $/, IO#gets...

IO#each(limit, chomp: false) -> Enumerator (12.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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(limit, chomp: false) {|line| ... } -> self (12.0)

IO の現在位置から 1 行ずつ文字列として読み込み、それを引数として 与えられたブロックを実行します。

...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...
<< 1 2 > >>