title: Find the index in an ArrayList that contains a string
body: <p>By using Jsoup I parse HTML from a website to populate an <code>ArrayList</code> with what I needed to fetch from the website. So now I have an <code>ArrayList</code> that is filled with strings. I want to find the index in that list that contains a certain string. For example, I know that somewhere in the list, in some index, there is the string(literal) "Claude" but I can't seem to make any code that finds the index that <code>contains</code> "Claude" in the <code>ArrayList</code>... here is what I have tried but returns <code>-1</code> (not found):</p>
  
  <pre><code>ArrayList &lt; String &gt; list = new ArrayList &lt; String &gt; ();
  String claude = "Claude";
  
  Document doc = null;
  try {
      doc = Jsoup.connect("http://espn.go.com/nhl/team/stats/_/name/phi/philadelphia-flyers").get();
  } catch (IOException e) {
      e.printStackTrace();
  }
  for (Element table: doc.select("table.tablehead")) {
      for (Element row: table.select("tr")) {
          Elements tds = row.select("td");
          if (tds.size() &gt; 6) {
              String a = tds.get(0).text() + tds.get(1).text() + tds.get(2).text() + tds.get(3).text() + tds.get(4).text() + tds.get(5).text() + tds.get(6).text();
  
              list.add(a);
  
              int claudesPos = list.indexOf(claude);
              System.out.println(claudesPos);
          }
      }
  }
  </code></pre>