From: manveru Date: 2005-09-09T12:20:55+09:00 Subject: Re: implode function? Julian Leviston wrote: > Is there are similar thing to the PHP version of implode in ruby? > > I want this to happen... > > z = %w[yeah, cool, mad, awesome, funky] > > x = z.implode > > x > > 'yeahcoolmadeawesomefunky' > > x = z.implode(', ') > > x > > 'yeah, cool, mad, awesome, funky' > > I guess I'll just go write one. > > Julian. > > z = %w[yeah cool mad awesome funky] => ["yeah", "cool", "mad", "awesome", "funky"] x = z.join(', ') => "yeah, cool, mad, awesome, funky"