Create a human-readable list with "and" inserted before the last element from a ruby list

Viewed 3700

How would you take a list and make it into a comma-separated string, with "and" before the last element in the array?

Take something like:

list1 = ['a','b','c']

And turn it into this:

=> "a, b, and c"

I remember ruby had a method for this. I've searched however, and couldn't find it. Thanks for the help.

3 Answers
Related