From: Jules Jacobs Date: 2006-01-19T00:05:29+09:00 Subject: Re: how to double single quote (beginner blockage) And what if the input string correctly contains double quotes?? ;-) String doesn't have a each_with_index method. class String def each_with_index counter = 0 each_byte do |char| yield char, counter counter += 1 end end end "abc".each_with_index do |char, index| puts char.chr + ' ' + index.to_s end Please note that char is an integer, so you have to call char.chr. Untested, but it should work. -- Posted via http://www.ruby-forum.com/.