On Sat, 5 Feb 2005 07:05:51 +0900, Navindra Umanee
<navindra / cs.mcgill.ca> wrote:
> Hi,
> 
> I have a question about The Ruby Way.  Pickaxe gives the following
> example for using iterators in Ruby:
> 
> a = [ "a", "b", "c" ]
> a.each {|x| print x, " -- " }
> 
> This outputs:
> 
> a -- b -- c --
> 
> But what if I want to print "a -- b -- c"?  What's the proper Ruby way
> of doing that?

a = ["a","b","c"]
puts a.join(' - ')

-- 
Regards,
John Wilger

-----------
Alice came to a fork in the road. "Which road do I take?" she asked.
"Where do you want to go?" responded the Cheshire cat.
"I don't know," Alice answered.
"Then," said the cat, "it doesn't matter."
- Lewis Carrol, Alice in Wonderland