finding if a string is contained in any of the strings in an enum
<p>I have a weird problem that I am trying to solve,</p>

<p>I have a enum with a string something like this</p>

<pre><code>public enum Enumm{
    Item1("i1"),
    Item2("i2");


    private String itemText;
    private Enumm(String inText){
        this.setitemText(inText);
    }
//  getter and setter for itemText not typing 
}
</code></pre>

<p>now in the other class I want to check if a string inputString contains either "i1" or "i2" but the problem is I cannot use a loop. </p>

<p>I know I can do this</p>

<pre><code> for(Enumm item: Enumm.values()){
        if (inputString.contains(item.getItemText)) {
           // do something
        }
   }
</code></pre>

<p>but the constraints of my problem do not allow me to do it this way</p>

<p>I am looking for something like</p>

<pre><code>if(inputString.contains(Enumm.Item1.getItemText||Enumm.Item2.getItemText)){
   //do something
} 
</code></pre>

<p>but is also dynamic such that it finds all the items in the enum
could anyone help me find a solution ?? Thanks in advance.</p>
