how to determine if a String starts with a specific character?
<p>Is there a built in method in Java to determine if a String starts with a specific character? How can I write, to an output file, only the lines that do not start with a defined character?</p>

<pre><code>   try {
        File input = new File("input");
        File output = new File("output");
        Scanner sc = new Scanner(input);
        PrintWriter printer = new PrintWriter(output);
        while (sc.hasNextLine()) {
            String s = sc.nextLine();
            printer.write(s);
        }
        printer.flush();
    }
    catch (FileNotFoundException e) {
        System.err.println("File not found. Please scan in new file.");
    }
</code></pre>
