From: Aldric Giacomoni Date: 2009-10-30T22:45:10+09:00 Subject: Re: How do you get the tail end of a string? Bertram Scharpf wrote: > My question was not _how_ to implement it but _why_ _not_ to add > it to the interpreter. > > Your method is returning `true' what Numeric#nonzero? will never > do. > > Bertram You want a method which returns "nil" if the string is empty, and the string itself if the string is nonempty? class String def nonempty? self.empty? ? nil : self end end Happy? ;-) Why wouldn't this be implemented by default, er, I don't know, I really can't think of a time when I'd need this type of behavior. -- Posted via http://www.ruby-forum.com/.