From: Jason Sweat Date: 2005-03-20T01:32:39+09:00 Subject: Re: strip and its evil brother strip! On Sun, 20 Mar 2005 01:07:15 +0900, Glenn Parker wrote: > Aquila wrote: > > Possibly a stupid question: why does strip! of a string with a single > > character in it give nil and strip the single character? > > I don't understand the behaviour of strip!... > > Looks like a bug to me. > > $ ruby -e 'p " x ".strip!' > "x" > > $ ruby -e 'p "x".strip!' > nil This came up on another thread recenly. It is a legacy behavior of the *! functions that they return nil if nothing changed. Regards, Jason http://blog.casey-sweat.us/