From: "Berger, Daniel" Date: 2006-03-14T00:55:33+09:00 Subject: Re: Proposal: String#notempty? > -----Original Message----- > From: Bertram Scharpf [mailto:lists@bertram-scharpf.de] > Sent: Monday, March 13, 2006 2:34 AM > To: ruby-core@ruby-lang.org > Subject: Re: Proposal: String#notempty? > > > Hi, > > Am Montag, 13. M�r 2006, 17:41:21 +0900 schrieb nobu@ruby-lang.org: > > At Mon, 13 Mar 2006 03:56:05 +0900, > > Bertram Scharpf wrote in [ruby-core:07518]: > > > I oftenly use `Numeric#nonzero?'. Actually, I miss its > equivalent, a > > > method maybe `String#notempty?', [...] > > > > Isn't nonempty but notempty? > > It should probably be, for consistency. > > Bertram Not needed: unless string.empty? For something like this you can just use Ruby's open classes: class String def not_empty? !empty? end end Regards, Dan