るりまサーチ

最速Rubyリファレンスマニュアル検索!
161件ヒット [1-100件を表示] (0.024秒)
トップページ > クエリ:self[x] > クエリ:chomp[x] > クエリ:each[x]

別のキーワード

  1. object yield_self
  2. _builtin yield_self
  3. _builtin self
  4. tracepoint self
  5. codeobject document_self=

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 > >>

IO#each(limit, chomp: false) {|line| ... } -> self (18366.0)

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

...すると連続する改行を行の区切りとみなします(パラグラフモード)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@raise IOError 自身が読み込み用にオ...
...: 引数なし][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,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//e...
...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: .."
//}
//emlist[例: chomp = true][ruby]{
IO.write("testfile", "This is l...

IO#each(rs = $/, chomp: false) {|line| ... } -> self (18366.0)

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

...すると連続する改行を行の区切りとみなします(パラグラフモード)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@raise IOError 自身が読み込み用にオ...
...: 引数なし][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,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//e...
...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: .."
//}
//emlist[例: chomp = true][ruby]{
IO.write("testfile", "This is l...

IO#each(rs, limit, chomp: false) {|line| ... } -> self (18366.0)

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

...すると連続する改行を行の区切りとみなします(パラグラフモード)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@raise IOError 自身が読み込み用にオ...
...: 引数なし][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,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//e...
...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: .."
//}
//emlist[例: chomp = true][ruby]{
IO.write("testfile", "This is l...

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

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

...すると連続する改行を行の区切りとみなします(パラグラフモード)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@raise IOError 自身が読み込み用にオ...
...: 引数なし][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,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//e...
...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: .."
//}
//emlist[例: chomp = true][ruby]{
IO.write("testfile", "This is l...

IO#each(rs = $/, chomp: false) -> Enumerator (18266.0)

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

...すると連続する改行を行の区切りとみなします(パラグラフモード)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@raise IOError 自身が読み込み用にオ...
...: 引数なし][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,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//e...
...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: .."
//}
//emlist[例: chomp = true][ruby]{
IO.write("testfile", "This is l...

絞り込み条件を変える

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

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

...すると連続する改行を行の区切りとみなします(パラグラフモード)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@raise IOError 自身が読み込み用にオ...
...: 引数なし][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,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//e...
...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: .."
//}
//emlist[例: chomp = true][ruby]{
IO.write("testfile", "This is l...

IO#each_line(limit, chomp: false) {|line| ... } -> self (6366.0)

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

...すると連続する改行を行の区切りとみなします(パラグラフモード)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@raise IOError 自身が読み込み用にオ...
...: 引数なし][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,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//e...
...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: .."
//}
//emlist[例: chomp = true][ruby]{
IO.write("testfile", "This is l...

IO#each_line(rs = $/, chomp: false) {|line| ... } -> self (6366.0)

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

...すると連続する改行を行の区切りとみなします(パラグラフモード)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@raise IOError 自身が読み込み用にオ...
...: 引数なし][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,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//e...
...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: .."
//}
//emlist[例: chomp = true][ruby]{
IO.write("testfile", "This is l...

IO#each_line(rs, limit, chomp: false) {|line| ... } -> self (6366.0)

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

...すると連続する改行を行の区切りとみなします(パラグラフモード)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@raise IOError 自身が読み込み用にオ...
...: 引数なし][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,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//e...
...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: .."
//}
//emlist[例: chomp = true][ruby]{
IO.write("testfile", "This is l...

String#each_line(rs = $/, chomp: false) {|line| ... } -> self (6317.0)

文字列中の各行に対して繰り返します。 行の区切りは rs に指定した文字列で、 そのデフォルト値は変数 $/ の値です。 各 line には区切りの文字列も含みます。

...
(つまり空行で分割します)。

@param rs 行末を示す文字列
@param chomp true を指定すると各行の末尾から rs を取り除きます。

//emlist[例][ruby]{
"aa\nbb\ncc\n".each_line do |line|
p line
end
# => "aa\n"
# => "bb\n"
# => "cc\n"

p "aa\nbb\ncc...

絞り込み条件を変える

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

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

...すると連続する改行を行の区切りとみなします(パラグラフモード)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@raise IOError 自身が読み込み用にオ...
...: 引数なし][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,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//e...
...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: .."
//}
//emlist[例: chomp = true][ruby]{
IO.write("testfile", "This is l...

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

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

...すると連続する改行を行の区切りとみなします(パラグラフモード)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@raise IOError 自身が読み込み用にオ...
...: 引数なし][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,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//e...
...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: .."
//}
//emlist[例: chomp = true][ruby]{
IO.write("testfile", "This is l...

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

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

...すると連続する改行を行の区切りとみなします(パラグラフモード)。
@param limit 最大の読み込みバイト数
@param chomp true を指定すると各行の末尾から "\n", "\r", または "\r\n" を取り除きます。

@raise IOError 自身が読み込み用にオ...
...: 引数なし][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,\n"
# "3: This is line three,\n"
# "4: And so on..."
//}
//e...
...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: .."
//}
//emlist[例: chomp = true][ruby]{
IO.write("testfile", "This is l...
<< 1 2 > >>