From: ts Date: 2002-01-30T02:49:32+09:00 Subject: Re: newbie help String#method! >>>>> "L" == Larry Forrister writes: L> How do you create an in place modification method based on or equivalent to the L> one listed below? i.e.... proper_case! Well, there are many ways. A stupid one is class String def proper_case dup.proper_case! end def proper_case! @pc=' ' @rs='' i = 0 self.each_byte{|@ib| @ic=@ib.chr if @pc==' ' self[i] = @ic.upcase end @pc=@ic i += 1 } self end end p.s.: string.gsub(/(?:^| )\w/) { $&.upcase } Guy Decoux