Short form for adding [] contents?

Hi
Just for getting nice Ruby code:
a=[['a','b'],['d','e'],['g','h','i']]
Is there a method for concatenating the contents of each field?
=> result=['ab', 'de', 'ghi']
How could this bw done nicely?

collect(... a[0]+a[1]...) is not very nice...

2nd:
arr.concat should be renamed to .concat! !
- whats your opinion?

Thank you
Berg

a=[['a','b'],['d','e'],['g','h','i']]
a.map!(&:join)

ยทยทยท

On Wed, Jun 1, 2016 at 4:14 PM, A Berger <aberger7890@gmail.com> wrote:

Hi
Just for getting nice Ruby code:
a=[['a','b'],['d','e'],['g','h','i']]
Is there a method for concatenating the contents of each field?
=> result=['ab', 'de', 'ghi']
How could this bw done nicely?

collect(... a[0]+a[1]...) is not very nice...

2nd:
arr.concat should be renamed to .concat! !
- whats your opinion?

Thank you
Berg

Unsubscribe: <mailto:ruby-talk-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-talk&gt;

--
*Kevin D. Deisz*
Localytics Software Engineer