Adam Akhtar wrote: > If i have a string "abc" and want to make it like this "aabbcc", how do > i go about it? > > I thought convert it into an array and then use string.map{|x| x << x} > > though i havnt tested that yet. Is there a better way or a string method > that saves me from having to convert it into an array? I strongly doubt that this is the only way, but I'll offer irb(main):004:0> "abc".gsub(/./) { |c| c + c} => "aabbcc" Now let's see how many other ways people can think of... -- Posted via http://www.ruby-forum.com/.