split拆分数组长度问题详解编程语言

package test; 
 
public class test1_format { 
 
    public static void main(String[] args) { 
         System.out.println("1&".split("&").length);//长度为1 
         System.out.println("1&1".split("&").length);//长度为2 
         System.out.println("1&&&".split("&").length);//长度为1 
         System.out.println("&1".split("&").length);//长度为2 
          
    } 
}

 split拆分数组长度问题详解编程语言

原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/7525.html

(0)
上一篇 2021年7月18日 18:45
下一篇 2021年7月18日 18:45

相关推荐

发表回复

登录后才能评论