From: Sebastian Hungerecker Date: 2008-10-22T07:22:55+09:00 Subject: Re: Stripping characters off a string Chris Causer wrote: > > your_string = "abcdef" # => "abcdef" > > your_string[-4,4] = '' # => "" > > your_string            # => "ab" > > Does that really work Yes, it does. If you copy and paste that code into irb, you'll see the exact output you see above (minus the # plus newlines plus the irb prompt) > I always thought that > >  'string'[a,b] > > was to take a substring beginning at a of length b. That's right. > In your case, you'd > just get the last 4 characters 'cdef'. Leaving the characters "ab", which is exactly what he showed in the code above. -- Jabber: sepp2k@jabber.org ICQ: 205544826