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

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

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -