From: "David A. Black" Date: 2009-11-03T02:36:06+09:00 Subject: Re: How do you get the tail end of a string? --1926193751-156272325-1257183352=:27068 Content-Type: MULTIPART/MIXED; BOUNDARY="1926193751-156272325-1257183352=:27068" 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-156272325-1257183352=:27068 Content-Type: TEXT/PLAIN; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8BIT On Tue, 3 Nov 2009, gf wrote: > > > On Oct 30, 4:11�am, Bertram Scharpf wrote: > [...] >> By the way: Still I'm convinced that there should be a >> `String#notempty?' method corresponding to `Numeric#nonzero?'. >> >> Bertram >> >> -- >> Bertram Scharpf >> Stuttgart, Deutschland/Germanyhttp://www.bertram-scharpf.de > > Maybe I'm totally missing the point here, but I thought String.any? > was good enough to tell whether a string has contents: > > 'asdf'.any? # => true > ''.any? # => false > > 'asdf'.empty? # => false > ''.empty? # => true See my earlier post. The problem is: $ ruby191 -e '"abc".any?' -e:1:in `
': undefined method `any?' for "abc":String (NoMethodError) because strings are not Enumerable in 1.9. 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-156272325-1257183352=:27068-- --1926193751-156272325-1257183352=:27068--