From: Mr Pinto Date: 2006-08-11T12:48:24+09:00 Subject: Re: Overriding String#[] > But, keep in mind that while: > > irb(main):001:0> "abc"[1] > => 98 > > you can get the result you want without changing Strings [] method. > > irb(main):002:0> "abc"[1..1] > => "b" Or: irb(main):001:0> str = "abc"[1].chr => "b" irb(main):002:0> str.class => String The []= method should already be doing what you want: irb(main):001:0> str = "abc" => "abc" irb(main):002:0> str[1] = "d" => "d" irb(main):003:0> str => "adc"