From: Warren Brown Date: 2003-07-29T01:03:28+09:00 Subject: Re: Should String#strip take a parameter? matz, >> 1) rstrip removes "\0", lstrip doesn't. [disharmonic] >> 2) feature is added elsewhere. >> 3) change is backed-out and forgotten. > > or > 4) rstrip removes sequence of "\0" at the end of string. lstrip > doesn't. Since String#strip was originally intended to remove leading and trailing whitespaces, it seems strange for it to also strip "\0"s (leading or trailing). I have never seen a language where whitespace included "\0", and Ruby does not include "\0" in any other definition of whitespace. However, if we allowed the String#strip methods to accept a regular expression as a parameter (as has been suggested) then this becomes a non-issue. The old (1.6) functionality can stay the same, and people that want to strip trailing "\0"s can do this via a simple regular expression. This is a fairly easy change to the String#strip methods, and could be included in the 1.8 preview6 if there are problems with preview5. I would be happy to provide the patches. - Warren Brown