Java 字符串拆分(拆分字符串)

String sourceStr = "1,2,3,4,5";
String[] sourceStrArray = sourceStr.split(",");
for (int i = 0; i < sourceStrArray.length; i++) {
    System.out.println(sourceStrArray[i]);

}

 

posted @ 2017-06-19 21:18 emanlee 阅读(...) 评论(...) 编辑 收藏