title: Loop through stack using traditional for-loop in Java
body: <p>Why doesn't this work: </p>
  
  <p>I have two items on the stack, but it goes through the loop once</p>
  
  <pre><code>for (int i = 0; i &lt; stack.size(); i++) {
              String[] values = stack.pop().trim().replaceAll(" ", "").split("/");
              String[] moveList = values[0].trim().replaceAll(" ", "").split("-");
  }
  </code></pre>