Convert range to set : to Set « Range « Ruby






Convert range to set


require 'set'
(1..3).to_set     # => #<Set: {1, 2, 3}>

 

Related examples in the same category