title: Ruby way to check if a string is not blank?
body: <p>What's the best way to check if a variable is not blank in an else if condition in Ruby (not Rails)?</p>
  
  <pre><code>elsif not variable.to_s.empty?
    # do something
  end
  </code></pre>
  
  <p>or </p>
  
  <pre><code>elsif !variable.to_s.empty?
    # do something
  end
  </code></pre>
  
  <p>or</p>
  
  <pre><code>elsif variable.to_s.length &gt; 0
    # do something
  end
  </code></pre>