Loading

String split

String split

        String[] split = "".split(",");
        String[] split1 = ",".split(",");
        String[] split2 = "a,b,c,,".split(",");
        String[] split3 = "a,b,c,".split(",");
        String[] split4 = ",a,".split(",");
        String[] split5 = ",a,,b,c,,".split(",");

        String[] split6 = StringUtils.split("", ",");
        String[] split7 = StringUtils.split(",", ",");
        String[] split8 = StringUtils.split("a,b,c,,", ",");
        String[] split9 = StringUtils.split("a,b,c,", ",");
        String[] split10 = StringUtils.split(",a,", ",");
        String[] split11 = StringUtils.split(",a,,b,c,,", ",");

引入:

    <dependency>
      <groupId>org.apache.commons</groupId>
      <artifactId>commons-lang3</artifactId>
      <version>3.7</version>
    </dependency>

 

posted @ 2018-07-30 22:54  stono  阅读(155)  评论(0编辑  收藏  举报