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 } }
原创文章,作者:ItWorker,如若转载,请注明出处:https://blog.ytso.com/tech/pnotes/7525.html