p(String.valueOf("5".split("\\.").length)); //print "1"
p(String.valueOf(".5".split("\\.").length)); //print "2"
p(String.valueOf("\"\".5".split("\\.").length));//print "2"
p(String.valueOf("5.".split("\\.").length)); //print "1"
p(String.valueOf("5.\"\"".split("\\.").length));//print "2"
p(String.valueOf("".split("hi").length));//print "1"
p(String.valueOf("hi?".split("\\?").length)); //pring "1"
还有:
" hi".split("\\s+") = {"","hi"}