-4
我已经做了一个string.split,然后调用数组的第一个位置,但出于某种原因,所有的数组结果都出现了。这是我的代码如何在java中进行分割?
try {
String xx = "";
for (int i = 0; i < row; i++) {
for (int c = 0; c < col; c++) {
Cell z = s.getCell(c, i);
xx = xx + z.getContents() + "\n";
}
xx = xx + "\n";
}
//I do the split here but the result[0] = all the information
String result[] = xx.split(",");
textView.setText(result[0]);
} catch (Exception e) {
}
这是输出的图像: Description of the output
你不在'字符串'之间加''' –
所以你能帮我吗? – jose
'z.getContents()'返回的字符串格式是什么?举一个'String'的例子。 –