From: Aldric Giacomoni Date: 2009-12-10T23:15:08+09:00 Subject: human-readable listing of array elements This took me less than a minute to write, but I don't know if it's as elegant as it could be. Are there more "Ruby-like ways(tm)" to write this? def stringify array return array[0] if array.size == 1 string = "" array.each_with_index do |element, index| case index when array.size - 1 # last item string += " and #{element}" when 0 string += "#{element}" else string += ", #{element}" end end string end -- Posted via http://www.ruby-forum.com/.