Matt's post below got me thinking about how I would accomplish the same thing in Ruby, turning an array into a string with each element separated by a comma. Here's what I came up with.

array_of_strings = ["foo", "bar", "foobar"]
str = array_of_strings.collect{|a| a + ", "}.to_s.chop.chop
=> "foo, bar, foobar"

Related posts:

  1. PHP Array to String
  2. Flickr, RSS, and Ruby
  3. Installing Ruby Enterprise Edition with Phusion Passenger
  4. Ruby On Rails and SliceHost Part 1: Initial Setup