Chuck Brotman <brotman / nc.rr.com> writes:

> Hi,
>
> I want to print an array (of strings, mostly) with commas separating the
> elements (so it would look like the result in the irb

[snip]

>
> Is there a nice  ruby idiom to do what I want (or to simply produce the
> necessary string for printing?

a = ["one", "two", "three"]
puts a.inspect
puts "[" + a.join(", ") + "]"

# >> ["one", "two", "three"]
# >> [one, two, three]