るりまサーチ

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

別のキーワード

  1. _builtin new
  2. _builtin inspect
  3. _builtin []
  4. _builtin to_s
  5. _builtin each

検索結果

REXML::Elements#delete(element) -> Element (18149.0)

element で指定した子要素を取り除きます。

...oc.root.elements.delete b # => <b/>
doc.root.to_s # => "<a><c/><c id='1'/></a>"
doc.elements.delete("a/c[@id='1']") # => <c id='1'/>
doc.root.to_s # => "<a><c/></a>"
doc.root.elements.delete 1 # => <c/>
doc.root.to_s...
...# => "<a/>"
doc.root.elements.delete '/a'
doc.root.to_s # => ""
//}...

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

子要素を削除します。

...s#delete

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new '<a><b/><c/><c id="1"/><d/><c/></a>'
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 # => "<a/>"
//}...

REXML::Element#delete_namespace(namespace = "xmlns") -> self (6125.0)

名前空間を要素から削除します。

...除します。

@param namespace 削除する名前空間の prefix

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new "<a xmlns:foo='bar' xmlns='twiddle'/>"
doc.root.delete_namespace
doc.to_s # => "<a xmlns:foo='bar'/>"
doc.root.delete_namespace 'foo'
doc.to_s # => "<a/>"
//}...

REXML::Elements#delete_all(xpath) -> [REXML::Element] (6113.0)

xpath で指定した XPath 文字列にマッチする要素をすべて取り除きます。

...べて取り除きます。

@param xpath 取り除く要素を指し示す XPath 文字列

//emlist[][ruby]{
require 'rexml/document'
doc = REXML::Document.new('<a><c/><c/><c/><c/></a>')
doc.elements.delete_all("a/c") # => [<c/>, <c/>, <c/>, <c/>]
doc.to_s # => "<a/>"
//}...

NEWS for Ruby 2.5.0 (36.0)

NEWS for Ruby 2.5.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...11547
* do/end ブロック内部で rescue/else/ensure を書けるようになりました 12906
* 文字列の式展開内部の暗黙の to_s 呼び出しにも refinements が影響するようになりました 13812

=== 組み込みクラスの更新

* Array
* Array#append を...
...* String#start_with? は正規表現を受け取れるようになりました 13712
* String#delete_prefix, String#delete_prefix! を追加 12694
* String#delete_suffix, String#delete_suffix! を追加 13665
* String#each_grapheme_cluster, String#grapheme_clusters を追加。結...
...ml
* https://blog.rubygems.org/2017/08/27/2.6.13-released.html

* securerandom
* SecureRandom.alphanumeric を追加

* set
* Set#to_s を Set#inspect の別名として追加 13676
* Set#=== を Set#include? の別名として追加 13801
* Set#reset 6589

* stringio...

絞り込み条件を変える

NEWS for Ruby 3.0.0 (24.0)

NEWS for Ruby 3.0.0 このドキュメントは前回リリース以降のバグ修正を除くユーザーに影響のある機能の変更のリストです。

...* String#*
* String#capitalize
* String#center
* String#chomp
* String#chop
* String#delete
* String#delete_prefix
* String#delete_suffix
* String#downcase
* String#dump
* String#each_char
* String#each_grapheme_cluster
*...
...tinuously improve the coverage of language features, analysis performance, and usability.

//emlist[][ruby]{
# test.rb
def foo(x)
if x > 10
x.to_s
else
nil
end
end

foo(42)
//}

//emlist{
$ typeprof test.rb
# Classes
class Object
def foo : (Integer) -> String?
end
//}

== Miscellaneo...

ruby 1.6 feature (18.0)

ruby 1.6 feature ruby version 1.6 は安定版です。この版での変更はバグ修正がメイン になります。

...まり、名前解
決中にThreadが切替え可能ということです)

require 'resolv'
p Resolv.new.getaddress("www.ruby-lang.org").to_s

=> /usr/local/lib/ruby/1.6/resolv.rb:160: warning: timeout (...) interpreted as method call
/usr/local/lib/ruby/1.6/resolv.rb:55: warni...
...Abortしていました。((<ruby-dev:13432>))

h = { 10 => 100, 20 => 200 }
h2 = { }

h.each { |k, v|
if (k == 10)
h.delete(10)
h2.replace(h) # => Abort core dumped
end
}

: $SAFE / ((<File>)).unlink

File.unlink は引数が汚染されてなくて...
...e 節の指定が可能になりました

obj = Object.new
def obj.foo
rescue
ensure
end

: ((<String>))#count
: ((<String>))#delete
: ((<String>))#squeeze
: ((<String>))#tr
: ((<String>))#tr_s
'\-' で '-' を指定可能になりました(tr! 等、bang method も同様)。...