るりまサーチ

最速Rubyリファレンスマニュアル検索!
626件ヒット [101-200件を表示] (0.149秒)

別のキーワード

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

ライブラリ

クラス

モジュール

キーワード

検索結果

<< < 1 2 3 4 ... > >>

Array#delete(val) { ... } -> object (24239.0)

指定された val と == で等しい要素を自身からすべて取り除きます。 等しい要素が見つかった場合は最後に見つかった要素を、 そうでない場合には nil を返します。

...つからなかったときにブロッ
クを評価してその結果を返します。

@
param val 自身から削除したい値を指定します。

//emlist[例][ruby]{
array = [1, 2, 3, 2, 1]
p array.delete(2) #=> 2
p array #=> [1, 3, 1]

# ブロックなしの引数に...
...nil を渡すとその戻り値から削除が
# 行われたかどうかの判定をすることはできない
ary = [nil,nil,nil]
p ary.delete(nil) #=> nil
p ary #=> []
p ary.delete(nil) #=> nil
//}...

CSV::Table#delete(index_or_header) -> object (24232.0)

指定された行か列を削除して返します。

...V::Table#by_col!,
CSV::Table#by_row! を使用してください。

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

row1 = CSV::Row.new(["header1", "header2"], ["row1_1", "row1_2"])
row2 = CSV::Row.new(["header1", "header2"], ["row2_1", "row2_2"])
t
able = CSV::Table.new([row1, row2])
t
able.delete(1)
t
able.to_a...
...# => [["header1", "header2"], ["row1_1", "row1_2"]]
//}

@
see CSV::Table#by_col!, CSV::Table#by_row!, CSV::Table#delete_if...

Net::HTTPHeader#delete(key) -> [String] | nil (24232.0)

key ヘッダフィールドを削除します。

...します。

@
param key 削除するフィールド名
@
return 取り除かれたフィールドの値を返します。
key ヘッダフィールドが存在しなかった場合には
nil を返します。

//emlist[例][ruby]{
require 'net/http'

uri = URI.parse('http://www.exam...
...ple.com/index.html')
req = Net::HTTP::Get.new(uri.request_uri)
req.content_length = 10
req.content_length # => 10
req.delete("Content-Length") # => ["10"]
req.content_length # => nil
//}...

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

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

...

@
param 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")...

REXML::Attributes#delete_all(name) -> [REXML::Attribute] (12326.0)

name という名前を持つ属性をすべて削除します。

...

@
param name 削除する属性の名前

//emlist[][ruby]{
require 'rexml/document'

doc = REXML::Document.new(<<-EOS)
<root xmlns:foo="http://example.org/foo"
xmlns:bar="http://example.org/bar">
<a foo:att='1' bar:att='2' att='&lt;'/>
</root>
EOS
a = doc.get_elements("/root/a").first...
...a.attributes.delete_all("att") # => [att='&lt;']
a # => <a foo:att='1' bar:att='2'/>
//}...

絞り込み条件を変える

String#delete_suffix!(suffix) -> self | nil (12280.0)

self の末尾から破壊的に suffix を削除します。

...

@
param suffix 末尾から削除する文字列を指定します。

@
return 削除した場合は self、変化しなかった場合は nil

//emlist[][ruby]{
"hello".delete_suffix!("llo") # => "he"
"hello".delete_suffix!("hel") # => nil
//}

@
see String#chomp!
@
see String#chop!
@
see String#d...
...elete_prefix!
@
see String#delete_suffix
@
see String#end_with?...

String#delete_suffix(suffix) -> String (12280.0)

文字列の末尾から suffix を削除した文字列のコピーを返します。

...

@
param suffix 末尾から削除する文字列を指定します。

@
return 文字列の末尾から suffix を削除した文字列のコピー

//emlist[][ruby]{
"hello".delete_suffix("llo") # => "he"
"hello".delete_suffix("hel") # => "hello"
//}

@
see String#chomp
@
see String#chop
@
see String...
...#delete_prefix
@
see String#delete_suffix!
@
see String#end_with?...

String#delete_prefix!(prefix) -> self | nil (12268.0)

self の先頭から破壊的に prefix を削除します。

...

@
param prefix 先頭から削除する文字列を指定します。

@
return 削除した場合は self、変化しなかった場合は nil

//emlist[][ruby]{
"hello".delete_prefix!("hel") # => "lo"
"hello".delete_prefix!("llo") # => nil
//}

@
see String#delete_prefix
@
see String#delete_suffi...
...x!
@see String#start_with?...

String#delete_prefix(prefix) -> String (12268.0)

文字列の先頭から prefix を削除した文字列のコピーを返します。

...

@
param prefix 先頭から削除する文字列を指定します。

@
return 文字列の先頭から prefix を削除した文字列のコピー

//emlist[][ruby]{
"hello".delete_prefix("hel") # => "lo"
"hello".delete_prefix("llo") # => "hello"
//}

@
see String#delete_prefix!
@
see String#delete_...
...suffix
@
see String#start_with?...

REXML::Element#delete_element(element) -> REXML::Element (12262.0)

子要素を削除します。

...削除します。

element で削除する要素を指定できます。整数、文字列、REXML::Element
オブジェクトのいずれかが指定できます。

REXML::Element を指定すると、その要素が削除されます。
整数を指定すると、element 番目の要素を削除...
...すると、XPath としてマッチする要素を削除します。
複数の要素がマッチする場合はそのうち1つが削除されます。

@
param element 削除する要素
@
see REXML::Elements#delete

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b/><c/><c...
...doc.delete_element("/a/b")
doc.to_s # => "<a><c/><c id='1'/><d/><c/></a>"
doc.delete_element("a/c[@id='1']")
doc.to_s # => "<a><c/><d/><c/></a>"
doc.root.delete_element("c")
doc.to_s # => "<a><d/><c/></a>"
doc.root.delete_element("c")
doc.to_s # => "<a><d/></a>"
doc.root.delete_element(1)
doc.to_s...

絞り込み条件を変える

<< < 1 2 3 4 ... > >>