Checking if a line starts with contents in a list
<p>I have a list that looks like this:</p>

<pre><code>List&lt;String&gt; messages = Arrays.asList("//", "/*", "*", "}", "{");
</code></pre>

<p>I then read in a file and go through it line by line.  I'd like to check to see if the beginning of the line matches any of what's in the list.</p>

<p>I was doing it this way earlier, but this doesn't seem like it's the most efficient way to accomplish what I'm trying to do:</p>

<pre><code>/*
if (!strLine.startsWith("//") &amp;&amp; !strLine.startsWith("/*") &amp;&amp; !strLine.startsWith("*")  &amp;&amp; !strLine.startsWith("}") &amp;&amp; !strLine.startsWith("{")) {
System.out.println(strLine);
}
*/
</code></pre>

<p>Any suggestions on what would be the best way to do this?</p>
