public static void main(String[] args){
public
static
void
main(String[] args){
String unSplit = "1,2,3,4,5,6,7";
String unSplit =
"1,2,3,4,5,6,7"
;
//根据长度取数组的最后一个元素
System.out.println(unSplit.split(",")[unSplit.split(",").length-1]);
System.out.println(unSplit.split(
","
)[unSplit.split(
).length-
1
]);
}
结果为: 7