String functions not working properly
<p>this is my program.It shouldnt print sentences starting with word "LTP" or sentences containing word "TRAILING" ,but it doesnt do that..I dont understand why.Please help me with this.</p>

<pre><code>import java.io.*;

public class FileInputDemo {
    public static void main(String args[]) {
        // args.length is equivalent to argc in C
        try {
            // Open the file that is the first
            // command line parameter
            FileInputStream fstream = new FileInputStream(
                    "C:\\Documents and Settings\\work\\Desktop\\New Folder\\New Folder\\02Apr2013log1.txt");
            // Convert our input stream to a
            // DataInputStream
            DataInputStream in = new DataInputStream(fstream);
            // Continue to read lines while
            // there are still some left to read
            while (in.available() != 0) {
                String s=in.readLine();
                // Print file line to screen
            if(s.startsWith("LTP") || s.contains("TRAILING"))
            {
                continue;
            }

            System.out.println(in.readLine());
            }

            in.close();
        } catch (Exception e) {
            System.err.println("File input error");
        }
    }
}
</code></pre>

<p>And this is the output</p>

<pre><code>Long trade Managers in list (from Limit removal process) 2
LTP 9708.0 Current Stop 9723.0 for Order ID BAA0001 Mode:- TRAILING
9711.0 9716.0 9707.0 9707.0 9710.62
BullishFactor [openBullishFactor=NEUTRAL, closeBullishfactor=BEARISH, closeToOpenFactor=MODERATE_BEARISH]
BarSharing [sharingType=LLLH, bodySharing=0.44]
LTP 9707.0 Current Stop 9717.0 for Order ID BAA0001 Mode:- TRAILING
</code></pre>
