This is my array:
array = [:one,:two,:three]
I want to apply to_s
method to all of my array elements to get array = ['one','two','three']
.
How can I do this (converting each element of the enumerable to something else)?
This will work:
array.map!(&:to_s)
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