From: Roger Pack Date: 2009-12-16T00:31:35+09:00 Subject: Re: what does this do? Tony Arcieri wrote: > On Mon, Dec 14, 2009 at 3:23 PM, Roger Pack > wrote: > >> >> "abcd"[0..2] = 'ggg' >> => "ggg" >> >> What is going on here, anybody have any ideas? >> > > Ruby lets you invoke #[]= on literals. Thanks for your and Josh's replies. It makes sense now. "abcd"[0..2] = 'ggg' is replacing abc with ggg -- it's just that the result isn't stored anywhere :) -r -- Posted via http://www.ruby-forum.com/.