2件ヒット
[1-2件を表示]
(0.061秒)
別のキーワード
検索結果
-
Set
# disjoint?(set) -> bool (18397.0) -
self と set が互いに素な集合である場合に true を返します。
...self と set が互いに素な集合である場合に true を返します。
逆に self と set の共通集合かを確認する場合には Set#intersect? を
使用します。
@param self Set オブジェクトを指定します。
@raise ArgumentError 引数が Set オブジェクトで......ない場合に発生します。
//emlist[][ruby]{
p Set[1, 2, 3].disjoint? Set[3, 4] # => false
p Set[1, 2, 3].disjoint? Set[4, 5] # => true
//}
@see Set#intersect?... -
Set
# reject! {|o| . . . } -> self | nil (9361.0) -
集合の各要素に対してブロックを実行し、その結果が真であるようなすべての 要素を削除します。
...返します。
//emlist[][ruby]{
s1 = Set['hello.rb', 'test.rb', 'hello.rb.bak']
s1.delete_if {|str| str =~ /\.bak\z/}
p s1 # => #<Set: {"hello.rb", "test.rb"}>
s2 = Set['hello.rb', 'test.rb', 'hello.rb.bak']
p s2.reject! {|str| str =~ /\.bak\z/} # => #<Set: {"hello.rb", "test.rb"}>
p s2.reject!...