title: is there a way to integrate a switch with String.contains("")?
body: <p>I need to check if a String object contains() various substrings and based on the results have different pieces of code execute.  Currently I have a series of else if.  I would like to convert it into a switch if possible.  Is there a way to do this?</p>
  
  <p>currently:</p>
  
  <pre><code> if (SomeString.contains("someSubString")) {
  
      . . . do something
  
   } else if (SomeString.contains("anotherSubString")) {
  
      . . . do something else
  
   } else if (SomeString.contains("yetanotherSubString")) {
  
      . . . do something even more different
  
   }  
   .
   .
   .
  </code></pre>