From: 7stud -- Date: 2012-09-15T13:14:28+09:00 Subject: Re: how to write a array into a string arr = ['a', 'b', 'c'] str = arr.each_with_index do |num, i| puts "#{i} => #{num}" end --output:-- 0 => a 1 => b 2 => c ["a", "b", "c"] You see, each_with_index() is a method call, and it has a return value, and the return value is the array you started with. puts() is also a method and it sends text to your screen. Displaying text on your screen does not save the text anywhere. -- Posted via http://www.ruby-forum.com/.