--1926193751-1576205640-1257102565799 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-1576205640-1257102565=:6799" This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --1926193751-1576205640-1257102565799 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT On Mon, 2 Nov 2009, Daniel Danopia wrote: > On Oct 30, 12:21 ¨Âí¬ ÂåòôòáÓãèáòð¼ìé®®®Àâåòôòáíóãèáòðæ®äå¾ ÷òïôåº >> Hi Aldric, >> >> Am Samstag, 31. Okt 2009, 01:46:10 +0900 schrieb Aldric Giacomoni: >> >>> Bertram Scharpf wrote: >>>> String#notempty? >> >>> Because some behavior is not there by default doesn't mean it's >>> a bias. >> >> That's what I wanted to say: I am convinced it should be there by >> default. It's just a few lines of code. It's pure logic when you >> have Numeric#nonzero? and it's very useful to build default >> values: >> >> str.notempty? || "(none)" analoigous to SQL-coalesce() >> > > So basically "String#notempty?" would be the same thing as > "String#any?" ? Strings aren't Enumerable in 1.9, so there's no String#any?. You can do string.chars.any? or string[0] or !string.empty? to test for contents. David -- The Ruby training with D. Black, G. Brown, J.McAnally Compleat Jan 22-23, 2010, Tampa, FL Rubyist http://www.thecompleatrubyist.com David A. Black/Ruby Power and Light, LLC (http://www.rubypal.com) --1926193751-1576205640-1257102565799-- --1926193751-1576205640-1257102565799--