るりまサーチ

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

別のキーワード

  1. rbconfig ruby
  2. fiddle ruby_free
  3. fiddle build_ruby_platform
  4. rake ruby
  5. rubygems/defaults ruby_engine

ライブラリ

クラス

モジュール

キーワード

検索結果

<< 1 2 3 > >>

Array#slice(range) -> Array | nil (24439.0)

指定された自身の部分配列を返します。Array#[] と同じです。

...返します。Array#[] と同じです。

@param pos Array#[] と同じです。

@param len Array#[] と同じです。

@param range Array#[] と同じです。

//emlist[例][ruby]{
p [0, 1, 2].slice(0, 2) #=> [0, 1]
p [0, 1, 2].slice(2..3) #=> [2]
p [0, 1, 2].slice(10, 1) #=> nil
/...

Array#slice(pos, len) -> Array | nil (24339.0)

指定された自身の部分配列を返します。Array#[] と同じです。

...返します。Array#[] と同じです。

@param pos Array#[] と同じです。

@param len Array#[] と同じです。

@param range Array#[] と同じです。

//emlist[例][ruby]{
p [0, 1, 2].slice(0, 2) #=> [0, 1]
p [0, 1, 2].slice(2..3) #=> [2]
p [0, 1, 2].slice(10, 1) #=> nil
/...

Array#slice(nth) -> object | nil (24139.0)

指定された自身の要素を返します。Array#[] と同じです。

...指定された自身の要素を返します。Array#[] と同じです。

@param nth 要素のインデックスを整数で指定します。Array#[] と同じです。

//emlist[例][ruby]{
p [0, 1, 2].slice(1) #=> 1
p [0, 1, 2].slice(2) #=> 2
p [0, 1, 2].slice(10) #=> nil
//}...

Enumerator::Lazy#slice_before {|elt| bool } -> Enumerator::Lazy (15350.0)

Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

...Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>

1.step.lazy.slice_before { |e| e % 3 == 0 }.t...
...ake(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}

@see Enumerable#slice_before...

Enumerator::Lazy#slice_before(initial_state) {|elt, state| bool } -> Enumerator::Lazy (15350.0)

Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

...Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>

1.step.lazy.slice_before { |e| e % 3 == 0 }.t...
...ake(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}

@see Enumerable#slice_before...

絞り込み条件を変える

Enumerator::Lazy#slice_before(pattern) -> Enumerator::Lazy (15350.0)

Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

...Enumerable#slice_before と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_before { |e| e.even? }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x00007f9f31844ce8>:each>>

1.step.lazy.slice_before { |e| e % 3 == 0 }.t...
...ake(5).force
# => [[1, 2], [3, 4, 5], [6, 7, 8], [9, 10, 11], [12, 13, 14]]
//}

@see Enumerable#slice_before...

Enumerator::Lazy#slice_after {|elt| bool } -> Enumerator::Lazy (15349.0)

Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

...Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>

1.step.lazy.slice_after { |e| e % 3 == 0 }.tak...
...e(5).force
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}

@see Enumerable#slice_after...

Enumerator::Lazy#slice_after(pattern) -> Enumerator::Lazy (15349.0)

Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

...Enumerable#slice_after と同じですが、配列ではなく Enumerator::Lazy を返します。

//emlist[例][ruby]{
1.step.lazy.slice_after { |e| e % 3 == 0 }
# => #<Enumerator::Lazy: #<Enumerator: #<Enumerator::Generator:0x007fd73980e6f8>:each>>

1.step.lazy.slice_after { |e| e % 3 == 0 }.tak...
...e(5).force
# => [[1, 2, 3], [4, 5, 6], [7, 8, 9], [10, 11, 12], [13, 14, 15]]
//}

@see Enumerable#slice_after...

String#byteslice(nth) -> String | nil (15325.0)

nth バイト目の文字を返します。nth が負の場合は文字列の末尾から数えます。 引数が範囲外を指定した場合は nil を返します。

...@param nth 文字の位置を表す整数を指定します。

@return 切り出した文字列を返します。戻り値の文字エンコーディングは自身
と同じです。

//emlist[例][ruby]{
"hello".byteslice(1) # => "e"
"hello".byteslice(-1) # => "o"
"\u3042".byteslice(0)...
...# => "\xE3"
"\u3042".byteslice(1) # => "\x81"
//}

@see String#slice...
<< 1 2 3 > >>