From: Rubist Rohit Date: 2011-04-22T20:56:31+09:00 Subject: Re: Reversing a string without using array, classes and reverse function Thanks all for brilliant examples. @Jose: Thanks so much. That was too close. Jose Calderon-Celis wrote in post #994451: > #!/usr/bin/env ruby > # > require 'rubygems' > > puts "ruby #{RUBY_VERSION}" > s = "This is to test reverse of a string" > p s > len=s.length > mycommand="" > for j in 1..len do > mycommand += s[-1*j] > end > p mycommand > Jose Calderon-Celis > 5199906-7970 > http://www.tm.com.pe/mensajes/ > > > > 2011/4/22 Rubist Rohit -- Posted via http://www.ruby-forum.com/.