Package java.util.regex

Examples of java.util.regex.Pattern.split()


    assertEquals(Pattern.compile("o").split("boo:and:foo", 5).length, 5);
    assertEquals(Pattern.compile("b").split("ab", -1).length, 2);
    // bug5391
    String s[];
    Pattern pat = Pattern.compile("x");
    s = pat.split("zxx:zzz:zxx", 10);
    assertEquals(s.length, 5);
    s = pat.split("zxx:zzz:zxx", 3);
    assertEquals(s.length, 3);
    s = pat.split("zxx:zzz:zxx", -1);
    assertEquals(s.length, 5);
View Full Code Here


    // bug5391
    String s[];
    Pattern pat = Pattern.compile("x");
    s = pat.split("zxx:zzz:zxx", 10);
    assertEquals(s.length, 5);
    s = pat.split("zxx:zzz:zxx", 3);
    assertEquals(s.length, 3);
    s = pat.split("zxx:zzz:zxx", -1);
    assertEquals(s.length, 5);
    s = pat.split("zxx:zzz:zxx", 0);
    assertEquals(s.length, 3);
View Full Code Here

    Pattern pat = Pattern.compile("x");
    s = pat.split("zxx:zzz:zxx", 10);
    assertEquals(s.length, 5);
    s = pat.split("zxx:zzz:zxx", 3);
    assertEquals(s.length, 3);
    s = pat.split("zxx:zzz:zxx", -1);
    assertEquals(s.length, 5);
    s = pat.split("zxx:zzz:zxx", 0);
    assertEquals(s.length, 3);
    // other splitting
    // negative limit
View Full Code Here

    assertEquals(s.length, 5);
    s = pat.split("zxx:zzz:zxx", 3);
    assertEquals(s.length, 3);
    s = pat.split("zxx:zzz:zxx", -1);
    assertEquals(s.length, 5);
    s = pat.split("zxx:zzz:zxx", 0);
    assertEquals(s.length, 3);
    // other splitting
    // negative limit
    pat = Pattern.compile("b");
    s = pat.split("abccbadfebb", -1);
View Full Code Here

    s = pat.split("zxx:zzz:zxx", 0);
    assertEquals(s.length, 3);
    // other splitting
    // negative limit
    pat = Pattern.compile("b");
    s = pat.split("abccbadfebb", -1);
    assertEquals(s.length, 5);
    s = pat.split("", -1);
    assertEquals(s.length, 1);
    pat = Pattern.compile("");
    s = pat.split("", -1);
View Full Code Here

    // other splitting
    // negative limit
    pat = Pattern.compile("b");
    s = pat.split("abccbadfebb", -1);
    assertEquals(s.length, 5);
    s = pat.split("", -1);
    assertEquals(s.length, 1);
    pat = Pattern.compile("");
    s = pat.split("", -1);
    assertEquals(s.length, 1);
    s = pat.split("abccbadfe", -1);
View Full Code Here

    s = pat.split("abccbadfebb", -1);
    assertEquals(s.length, 5);
    s = pat.split("", -1);
    assertEquals(s.length, 1);
    pat = Pattern.compile("");
    s = pat.split("", -1);
    assertEquals(s.length, 1);
    s = pat.split("abccbadfe", -1);
    assertEquals(s.length, 11);
    // zero limit
    pat = Pattern.compile("b");
View Full Code Here

    s = pat.split("", -1);
    assertEquals(s.length, 1);
    pat = Pattern.compile("");
    s = pat.split("", -1);
    assertEquals(s.length, 1);
    s = pat.split("abccbadfe", -1);
    assertEquals(s.length, 11);
    // zero limit
    pat = Pattern.compile("b");
    s = pat.split("abccbadfebb", 0);
    assertEquals(s.length, 3);
View Full Code Here

    assertEquals(s.length, 1);
    s = pat.split("abccbadfe", -1);
    assertEquals(s.length, 11);
    // zero limit
    pat = Pattern.compile("b");
    s = pat.split("abccbadfebb", 0);
    assertEquals(s.length, 3);
    s = pat.split("", 0);
    assertEquals(s.length, 1);
    pat = Pattern.compile("");
    s = pat.split("", 0);
View Full Code Here

    assertEquals(s.length, 11);
    // zero limit
    pat = Pattern.compile("b");
    s = pat.split("abccbadfebb", 0);
    assertEquals(s.length, 3);
    s = pat.split("", 0);
    assertEquals(s.length, 1);
    pat = Pattern.compile("");
    s = pat.split("", 0);
    assertEquals(s.length, 1);
    s = pat.split("abccbadfe", 0);
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.