Using a for loop in Java to process a string
<p>I can never get this to loop all the way through the string. I can't use >= or == in this loop it stops it from working :( help</p>

<pre><code>    int s = 0;
    String twocharacters = "";

    for (int i = 0; i &lt; value.length(); i++){

        char c = value.charAt(i);
        char w = value.charAt(i + 1);

        if (c == '/' &amp;&amp; w == '*' &amp;&amp; s == 0){
            s = 1;
        }
        else if (c == '*' &amp;&amp; w == '/' &amp;&amp; s == 1){
            s = 0;
        }
        else if (s == 0 &amp;&amp; c != ' ' &amp;&amp; c != '*' &amp;&amp; c != '/'){
            twocharacters += c;
            System.out.println(twocharacters);
        }
    }
</code></pre>
