Write out an array as a list with commas and an 'and'
1 2 def text_list(listtext,sep1=", ", sep2=", and ") 3 n=listtext.size 4 if n>1 : (listtext.first(n-1)).join(sep1) + sep2 +listtext.last 5 else listtext.first end 6 end 7 8 text_list(["cat", "dog", "bird"]) => "cat, dog, and bird"