title: Remove nil and blank string in an array in Ruby
body: <p>I am new to Ruby and stuck with this issue. Let's say I have an array like this:</p>
  
  <pre><code>arr = [1, 2, 's', nil, '', 'd']
  </code></pre>
  
  <p>and I want to remove nil and blank string from it, i.e. final array should be: </p>
  
  <pre><code>arr = [1, 2, 's', 'd']
  </code></pre>
  
  <p>I tried <code>compact</code> but it gives this:</p>
  
  <pre><code>arr.compact!
  arr #=&gt; [1, 2, 's', '', 'd'] doesn't remove empty string.
  </code></pre>
  
  <p>I was wondering if there's a smart way of doing this in Ruby.</p>