title: Ruby: how to tell if character is upper/lowercase
body: <p>I'm ashamed to ask this, because it seems like it ought to be obvious, but how does one tell whether a given character in a string is upper or lowercase in Ruby? I see no obvious canned solution in the <code>String</code> class.</p>
  
  <p>I've resorted to the following, which does not consider non-ASCII codes:</p>
  
  <pre><code>def is_lower?(c)
    c &gt;= 'a' &amp;&amp; c &lt;= 'z'
  end
  
  def is_upper?(c)
    ! is_lower(c)
  end
  </code></pre>
  
  <p>Something else I've considered is:</p>
  
  <pre><code>def is_lower?(c)
      c != c.upcase
  end
  </code></pre>
  
  <p>Is there something more idiomatic for this?</p>