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
Post a Comment