我有一个数组如下:
[[[Statistics (pH), Upright, Recumbent, Total], [, Upright Normal Recumbent Normal Total], [Normal], [Clearance pH : Channel 7], [Minimum, 2.42, 4.69, 2.42], [Maximum, 7.88, 7.51, 7.88], [Mean, 6.33, 6.41, 6.37], [Median, 6.62, 6.40, 6.49], [Standard Deviation, 0.91, 0.40, 0.73], [Variance, 0.84, 0.16, 0.54], [Gastric pH : Channel 8], [Minimum, 0.64, 0.57, 0.57], [Maximum, 7.86, 6.65, 7.86], [Mean, 2.12, 1.63, 1.93], [Median, 1.65, 1.24, 1.52], [Standard Deviation, 1.36, 0.99, 1.25], [Variance, 1.85, 0.99, 1.57]]]
我想从"Upright", "Recumbent", "Total"
[Statistics (pH), Upright, Recumbent, Total]
这是我的代码:
for (ArrayList<List<String>> row : StatspH) {
System.out.println(row);
for (List<String> rowInner : row){
rowInner.remove(0);
System.out.println(rowInner);
}
}
这将删除内部数组中的所有第一个元素,而我只需要如上所述..如何指定将其从中删除?
答案 0 :(得分:0)
for (ArrayList<List<String>> row2 : StatspH) {
row2.get(0).remove(1);
System.out.println("Result: " + row2);
}