Flowdock
to_s() public

Returns self.join.

   [ "a", "e", "i", "o" ].to_s   #=> "aeio"
Show source
Register or log in to add new notes.
March 18, 2012
0 thanks

Use Join to Turn Array Items into a String.

If you’re looking to take an array like

[ 'don', 'draper' ]

And get

'don draper'

Then use join instead:

[ 'don', 'draper' ].join( ' ' ) 

#=> 'don draper'