From: Alex Young Date: 2006-08-10T21:13:01+09:00 Subject: Re: extending String call with a #copy!(n) Une b�vue wrote: > i've allready extendy String class by a #copy(n) like that : > > class String > def copy(n) > out="" > (1..n).each {|i| out+=self} > return out > end > end > > however i'd like to extend also String with a #copy!(n) (in place which > would work like that : > > "*".copy!(4) > # => "****" > > the prob is to affect self ??? Use << (or concat). -- Alex