From: Harry Kakueki Date: 2011-04-22T20:15:34+09:00 Subject: Re: Reversing a string without using array, classes and reverse function On Fri, Apr 22, 2011 at 12:54 PM, Rubist Rohit wrote: > I am trying this: > > mystring = gets > mystring.scan(/..$/) {|x| puts x} > > It returns only the last character. Is it possible to add the above line > in loop? > > -- s = "I am a string." t = "" s.each_char{|f| t.insert(0,f)} p t #> ".gnirts a ma I" Harry