From: Rimantas Liubertas Date: 2011-03-24T08:07:52+09:00 Subject: Re: Converting PHP to Ruby I just had to do > > c = s[i] > > to get each letter one bye one, in one in each loop. It is not the best way to directly translate from other languages to Ruby. One of the interesting features of Ruby is the use of enumerators and blocks wherever possible, hence you will rarely need for loop in Ruby program. You don't need for loop to go over each character in the string. This snippet will print each char of the string: "my test string".chars {|c| puts c} There is my somewhat obscure implementation (needs Ruby 1.9 because of .rotate): https://gist.github.com/884209 Regards, Rimantas