码迷,mamicode.com
首页 > 编程语言 > 详细

Java String.split()小点

时间:2016-05-23 10:28:51      阅读:133      评论:0      收藏:0      [点我收藏+]

标签:

 

java String.split();

别的不说,单说其中一个问题,这个函数去切分空字符串时,得到的结果;

public static void main(String[] args) {
// String countType = "3,3";
String countType = "";
// String countType = null;
String[] a = countType.trim().split(",");
System.err.println(a.length);
if(null != a && a.length > 0){
System.err.println(a[0]);
}
}

这个打印的结果为:1

 

Java String.split()小点

标签:

原文地址:http://www.cnblogs.com/xiaolive/p/5518784.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!