In Java, how to find a string from an string array and why is the below example not working as expected
<p>how to find a string from an string array and In the below example i am always get search failure except search for first string but not others like second or third , i even tried with [indexof !=1 condition  instead of equals ] but it remains same result  and why ? - please advise . Thanks</p>

<p>My Example :</p>

<pre><code>String[] TEXT_ARRAY = {"first","second","third" };
    String parameter ="second";

    for (String string : TEXT_ARRAY) {
    System.out.println("****** [containsScript ? ]  IS EQUALS ?  " + parameter.toString().toUpperCase().equals(string.toString().toUpperCase()));
    }
</code></pre>
