title: Java for loop with an ArrayList
body: <p>Here is the contents of my ArrayList <code>contain</code> </p>
  
  <pre><code>HPDH-1,001, Check-out date: 7/7/7
  
  JTI-1,001, Check-out date: 7/7/7
  </code></pre>
  
  <p>My code:</p>
  
  <pre><code>for (int i = 0; i &lt; contain.size(); i++) {
      if (contain.get(i).contains(code)) {
          System.out.println(contain.get(i));
      }
  }
  </code></pre>
  
  <p>The thing is my variable code was String "JTI-1"
  Why isn't it giving me the JTI-1 output?
  I am trying to get it to display the value of the variable code.
  I want to remove the contain.get(i) if it would just give me the one I typed in.</p>