Using String.endswith() method on Java
<p>I have an array I want to check the the last digits if it is in the array.</p>

<p>Example:</p>

<pre><code>String[] types = {".png",".jpg",".gif"}

String image = "beauty.jpg";

Boolean true = image.endswith(types) // Note that this is wrong. The parameter required is a string not an array.
</code></pre>

<p>Please note:
I know I can check the with each individual item using a for loop.</p>

<blockquote>
  <p>I want to know if there is a more efficient way of doing this. Reason being is that image string is already on a loop on a constant change.</p>
</blockquote>
