title: Case insensitive matching in Java switch-case statement
body: <p>I was wondering if there is a way to perform case insensitive match in java switch case statement. the default implementation is <strong>case sensitive</strong>. Please see the example below.</p>
  
  <pre><code>public class SwitchCaseTest {
  
      /**
       * @param args
       */
       public static void main(String[] args) {
  
          switch ("UPPER") {
              case  "upper" :
                  System.out.println("true");
                  break;
  
              default:
                  System.out.println("false");
                  break;
          }
      }
  }
  </code></pre>
  
  <p>So above statement returns <code>false</code> as output. And i am trying make it work for <strong>case-insensitive</strong> match like <code>String.equalsIgnoreCase()</code> would do. I tried to convert both the string literal to lower case and then compare. but was unable to do so.</p>