title: Efficiency of equalsIgnoreCase() versus toUpperCase().equals and toLowerCase().equals
body: <p>The title says it all. My question regards the efficiency of different <code>String</code> equivalency methods. I frequently use <code>.equalsIgnoreCase(String str)</code> because I just have a thing for it. But I'm beginning to wonder if it may not be the most efficient method for finding equivalency between <code>Strings</code>. It seems to me that <code>.equalsIgnoreCase(String str)</code> is calling one of the case shifting methods <code>toUpperCase</code> or <code>toLowerCase</code> then calling <code>equals</code> in its definition, but I am likely wrong. So, which of these methods is more efficient in the following situation, or any situation for that matter?</p>
  
  <pre><code>int count = 0;//checks for face cards at indexes listed in selectedCards
                // Selected cards is Integer ArrayList
  
      for(; (count &lt; selectedCards.size() &amp;&amp; count &lt; 3); count++)
      {
          if(cardAt(selectedCards.get(count)).rank().equalsIgnoreCase("Queen"))
              count++;
          else if(cardAt(selectedCards.get(count)).rank().equalsIgnoreCase("King"))
              count++;
          if(cardAt(selectedCards.get(count)).rank().equalsIgnoreCase("Jack"))
              count++;
      }
  
      if(count == 3)
          return true;
      return false;
  </code></pre>