るりまサーチ

最速Rubyリファレンスマニュアル検索!
12件ヒット [1-12件を表示] (0.057秒)
トップページ > クエリ:ruby[x] > 種類:インスタンスメソッド[x] > クエリ:@[x] > クエリ:self[x] > クエリ:-[x] > クエリ:replace[x] > クラス:Array[x]

別のキーワード

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

ライブラリ

検索結果

Array#replace(another) -> self (18328.0)

配列の内容を配列 another の内容で置き換えます。

...配列 another の内容で置き換えます。

@
param another 配列を指定します。
配列以外のオブジェクトを指定した場合は to_ary メソッドに
よる暗黙の型変換を試みます。

@
raise TypeError 引数に配列以外の(暗黙の...
...型変換が行えない)オブジェクトを
指定した場合に発生します。

//emlist[例][ruby]{
a = [1, 2, 3]
a.replace [4, 5, 6]
p a #=> [4, 5, 6]
//}...