From: Matt Armstrong Date: 2003-02-04T04:18:38+09:00 Subject: Re: ruby-dev summary 19437-19455 Minero Aoki writes: > ARGF.each do |line| > print line if line.index(once 'PATTERN') > end > > Matz considers that the better plan is to make string literal create > an object only once. So long as the string is duped when modified. E.g. def mystring 'hi' end puts mystring.sub!(/h/, 'H') => Hi puts mystring => hi