るりまサーチ

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

別のキーワード

  1. _builtin delete
  2. _builtin delete_if
  3. cgi delete
  4. pop delete_all
  5. pop3 delete_all

ライブラリ

クラス

オブジェクト

キーワード

検索結果

Array#delete_at(pos) -> object | nil (18107.0)

指定された位置 pos にある要素を取り除きそれを返します。 pos が範囲外であったら nil を返します。

...暗黙の型変換を試みます。

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

//emlist[例][ruby]{
array = [0, 1, 2, 3, 4]
array.delete_at 2
p array #=> [0, 1, 3, 4]
//}...

Readline::HISTORY.delete_at(index) -> String | nil (18107.0)

index で指定したインデックスの内容をヒストリから削除し、その内容を返します。 該当する index の内容がヒストリになければ、 nil を返します。 index に 0 を指定すると Readline::HISTORY.shift と同様に最初の入力内容を削除します。 また、 -1 は最後の入力内容というように、index に負の値を指定することで、 最後から入力内容を取得することもできます。 index が -1 の場合は Readline::HISTORY.pop と同様に動作します。

...のヒストリのインデックスを指定します。

@raise NotImplementedError サポートしていない環境で発生します。

例:

require "readline"

Readline::HISTORY.push("foo", "bar", "baz")
Readline::HISTORY.delete_at(1)
p Readline::HISTORY.to_a #=> ["foo", "baz"]...

REXML::Parent#delete_at(index) -> REXML::Child | nil (18101.0)

子ノード列上の index で指定された場所の要素を取り除きます。

子ノード列上の index で指定された場所の要素を取り除きます。

取り除いだノードを返します。indexが範囲外である場合は何もせず
nil を返します。

REXML::Element#delete_attribute(key) -> REXML::Attribute | nil (6100.0)

要素から key という属性名の属性を削除します。

...素(文字列(属性名) or REXML::Attributeオブジェクト)

//emlist[][ruby]{
require 'rexml/document'
e = REXML::Element.new("E")
e.add_attribute("x", "foo"); e # => <E x='foo'/>
e.add_attribute("y:x", "bar"); e # => <E x='foo' y:x='bar'/>
e.delete_attribute("x"); e # => <E y:x='bar'/>
//}...

Readline::HISTORY.pop -> String (6.0)

ヒストリの最後の内容を取り出します。 最後の内容は、ヒストリから取り除かれます。

...で発生します。

例:

require "readline"

Readline::HISTORY.push("foo", "bar", "baz")
p Readline::HISTORY.pop #=> "baz"
p Readline::HISTORY.pop #=> "bar"
p Readline::HISTORY.pop #=> "foo"

@see Readline::HISTORY.push、Readline::HISTORY.shift、
Readline::HISTORY.delete_at...

絞り込み条件を変える

Readline::HISTORY.shift -> String (6.0)

ヒストリの最初の内容を取り出します。 最初の内容は、ヒストリから取り除かれます。

...発生します。

例:

require "readline"

Readline::HISTORY.push("foo", "bar", "baz")
p Readline::HISTORY.shift #=> "foo"
p Readline::HISTORY.shift #=> "bar"
p Readline::HISTORY.shift #=> "baz"

@see Readline::HISTORY.push、Readline::HISTORY.pop、
Readline::HISTORY.delete_at...