From: Hassan Schroeder Date: 2011-08-31T23:29:22+09:00 Subject: Re: Prepend a character to a string in ruby On Wed, Aug 31, 2011 at 7:19 AM, Michal Suchanek wrote: > It is sad there is no obvious method for that. But if it makes you happy, there can be :-) ruby-1.8.7-p352 > class String ruby-1.8.7-p352 ?> def >>(arg) ruby-1.8.7-p352 ?> self.insert(0, arg) ruby-1.8.7-p352 ?> end ruby-1.8.7-p352 ?> end => nil ruby-1.8.7-p352 > string = "bar" => "bar" ruby-1.8.7-p352 > string >> "foo" => "foobar" ruby-1.8.7-p352 > -- Hassan Schroeder ------------------------ hassan.schroeder@gmail.com http://about.me/hassanschroeder twitter: @hassan