instance method
Set#-
(::_Each[A]) -> self
set - enum → new_set
set.c
View on GitHub ↗
static VALUE
set_i_difference(VALUE set, VALUE other)
{
return set_i_subtract(rb_obj_dup(set), other);
}
Returns a new set built by duplicating the set, removing every element that appears in the given enumerable object.
Example
Set[1, 3, 5] - Set[1, 5] #=> Set[3] Set['a', 'b', 'z'] - ['a', 'c'] #=> Set["b", "z"]