Ruby: blank? without Rails -


i want have test:

if (line.blank?) do_stuff 

...but i'm in straight ruby, not rails. what's accepted idiom accomplishing same effect?

i'm doing string, testing .empty? not same testing .blank? (an whitespace string not empty, blank.)

from activesupport

line !~ /[^[:space:]]/ 

Comments

Popular posts from this blog

compilation - PHP install fails on Ubuntu 14 (make: *** [sapi/cli/php] Error 1) PHP 5.6.20 -

php - Passing multiple values in a url using checkbox -

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -