String split

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>

 

上一篇:commons-beanutils-1.8.3 和 commons-logging-1.1.1


下一篇:各种Utils [vaynexiao]