Package java.util

Examples of java.util.Scanner.delimiter()


    int i;

    this.myHarness.checkPoint ("Fisch String [" + input + "]");
    Scanner s1 = new Scanner (input);
    s1.useDelimiter (delimiter);
    tmpStr = s1.delimiter ().pattern ();
    this.myHarness.check (tmpStr, delimiter,
        "get / setDelimiter fail (\"" + tmpStr +
        "\" != \"" + delimiter);
    this.myHarness.check (s1.hasNext (), true, "first hasNext()");
    this.myHarness.check (s1.hasNextInt (), true, "first hasNextInt()");
View Full Code Here


public class ScannerTest {

    @Test
    public void testReadCypherFile() throws Exception {
        Scanner scanner = new Scanner("begin\nstart;\ncommit\nbegin\nstart;\ncommit").useDelimiter(Pattern.compile("(commit|begin|;)(\r?\n|$)", Pattern.CASE_INSENSITIVE));
        System.out.println("scanner.delimiter() = " + scanner.delimiter());
        assertEquals("start",scanner.next());
        assertEquals("",scanner.next());
        assertEquals("",scanner.next());
        assertEquals("start",scanner.next());
        assertEquals("",scanner.next());
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.