Is there an equivalent of array join()
for the Set
class in Ruby
? or best to just monkey patch my own on the Set class?
http://ruby-doc.org/stdlib-2.2.2/libdoc/set/rdoc/Set.html
What is wrong with set.to_a.join
?
Something to keep in mind: The documentation says that a "Set implements a collection of unordered values with no duplicates." That means the order is not guaranteed. For the to_a
method the documentation tells you that "the order of elements is uncertain".
I am not sure if a join
makes sense with this circumstances...
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With