title: Change For expression to lambda Java 8
body: <p>I want to change this expression from this for loop to a lambda expression using java 8 and I want to return the number position in the array that match with that value.</p>
  <pre><code>String[] values= {&quot;VALUE1&quot;, &quot;VALUE2&quot;, &quot;VALUE3&quot;};
  
  int stringIndex;
  for(stringIndex = 0; stringIndex &lt; values.length; stringIndex++)
      if(stringWithValue.contains(values[stringIndex])) break;
  </code></pre>
  <p>For example,</p>
  <p><code>stringWithValue = &quot;SomeOtherThingVALUE1&quot;</code> should return <strong>0</strong> and so on with the other values.</p>