るりまサーチ

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

別のキーワード

  1. _builtin to_i
  2. fiddle to_i
  3. matrix elements_to_i
  4. ipaddr to_i
  5. _builtin i

検索結果

<< 1 2 3 ... > >>

CSV::FieldInfo#index -> Integer (24313.0)

行内で何番目のフィールドかわかるゼロベースのインデックスを返します。

...ロベースのインデックスを返します。

//emlist[例][ruby]{
require 'csv'

csv = CSV.new("date1,date2\n2018-07-09,2018-07-10", headers: true)
csv.convert do |field,field_info|
p field_info.index
Date.parse(field)
end

p csv.first

# => 0
# => 1
# => #<CSV::Row "date1":#<Date: 2018-0...

MatchData#end(n) -> Integer | nil (18243.0)

n 番目の部分文字列終端のオフセットを返します。

...nil を返します。

@param n 部分文字列を指定する数値。

@raise IndexError 範囲外の n を指定した場合に発生します。

//emlist[例][ruby]{
/(foo)(bar)(BAZ)?/ =~ "foobarbaz"
p $~.end(0) # => 6
p $~.end(1) # => 3
p $~.end(2) # => 6
p $~.end(3) # => nil
p $~.end...
...(4) # => `end': index 4 out of matches (IndexError)
//}

@see MatchData#begin...

Gem::DependencyList.from_source_index(src_index) -> Gem::DependencyList (15508.0)

与えられた Gem::SourceIndex のインスタンスから自身を作成します。

...与えられた Gem::SourceIndex のインスタンスから自身を作成します。

@param src_index Gem::SourceIndex を指定します。

@see Gem::SourceIndex...

Prime::PseudoPrimeGenerator#each_with_index {|prime, index| ... } -> self (15336.0)

与えられたブロックに対して、素数を0起点の連番を渡して評価します。

...を返します。 ブロックを与えられなかった場合は Enumerator を返します。

//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end

# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}

@see Enumerator#with_index...

Prime::PseudoPrimeGenerator#with_index {|prime, index| ... } -> self (15336.0)

与えられたブロックに対して、素数を0起点の連番を渡して評価します。

...を返します。 ブロックを与えられなかった場合は Enumerator を返します。

//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end

# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}

@see Enumerator#with_index...

絞り込み条件を変える

Prime::PseudoPrimeGenerator#each_with_index -> Enumerator (15236.0)

与えられたブロックに対して、素数を0起点の連番を渡して評価します。

...を返します。 ブロックを与えられなかった場合は Enumerator を返します。

//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end

# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}

@see Enumerator#with_index...

Prime::PseudoPrimeGenerator#with_index -> Enumerator (15236.0)

与えられたブロックに対して、素数を0起点の連番を渡して評価します。

...を返します。 ブロックを与えられなかった場合は Enumerator を返します。

//emlist[例][ruby]{
require 'prime'
Prime::EratosthenesGenerator.new(10).each_with_index do |prime, index|
p [prime, index]
end

# [2, 0]
# [3, 1]
# [5, 2]
# [7, 3]
//}

@see Enumerator#with_index...

Enumerable#each_with_index(*args) {|item, index| ... } -> self (12457.0)

要素とそのインデックスをブロックに渡して繰り返します。

...with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。

@param args イテレータメソッド (each など) にそのまま渡されます。

//emlist[例][ruby]{
[5, 10, 15].each_wit...
...h_index do |n, idx|
p [n, idx]
end

# => [5, 0]
# [10, 1]
# [15, 2]
//}

//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end

# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}

@see Enumerator#with_index...

Array#each_index {|index| .... } -> self (12421.0)

各要素のインデックスに対してブロックを評価します。

...スに対してブロックを評価します。

以下と同じです。

//emlist[例][ruby]{
(0 ... ary.size).each do |index|
# ....
end

//}

ブロックが与えられなかった場合は、自身と each_index から生成した
Enumerator オブジェクトを返します。

@see Array#e...

Enumerable#each_with_index(*args) -> Enumerator (12257.0)

要素とそのインデックスをブロックに渡して繰り返します。

...with_index は offset 引数を受け取りますが、
each_with_index は受け取りません (引数はイテレータメソッドにそのまま渡されます)。

@param args イテレータメソッド (each など) にそのまま渡されます。

//emlist[例][ruby]{
[5, 10, 15].each_wit...
...h_index do |n, idx|
p [n, idx]
end

# => [5, 0]
# [10, 1]
# [15, 2]
//}

//emlist[引数ありの例][ruby]{
require 'stringio'
StringIO.new("foo|bar|baz").each_with_index("|") do |s, i|
p [s, i]
end

# => ["foo|", 0]
# ["bar|", 1]
# ["baz", 2]
//}

@see Enumerator#with_index...

絞り込み条件を変える

<< 1 2 3 ... > >>