On 28 Mar 2003 at 18:14, Tim Bates wrote: > What might be useful is for join to take a block which decides > what separator to use based on the value of the previous item, eg: > (1..10).to_a.join { |i| > i % 2 == 0 ? " " : "-" > } # => "1-2 3-4 5-6 7-8 9-10" > This is a trivial example, and I can't think of a real example off the top of > my head, so feel free to reject it on the grounds that it may not be useful, > but this just occurred to me and I thought I'd throw it out there... I don't have any use for this yet, too, but you could even pass both the last and the next item to the block. Regards, Pit