//"1,2;3,4,5;6,7,8,9" 转换成[1,2][3,4,5][6,7,8,9]
public class Test {
public static void main(String[] args) {
String s = "1,2;3,4,5;6,7,8,9";
String[] sub = s.split(";");
int[][] a = new int[sub.length][];
for(int i=0;i<sub.length;i++) {
String[] sr = sub[i].split(",");
a[i] = new int[sr.length];
for(int j=0;j<sr.length;j++) {
a[i][j]=Integer.parseInt(sr[j]);
}
}
for(int i=0;i<a.length;i++) {
for(int j=0;j<a[i].length;j++) {
System.out.print(a[i][j]+" ");
}
System.out.println();
}
}
}