解决POI读取Excel如何判断行是不是为空

如题所述

自己写一个判断行空的方法:
public static boolean isRowEmpty(Row row) {
for (int c = row.getFirstCellNum(); c < row.getLastCellNum(); c++) {
Cell cell = row.getCell(c);
if (cell != null && cell.getCellType() != Cell.CELL_TYPE_BLANK)
return false;
}
return true;
}
温馨提示:答案为网友推荐,仅供参考
相似回答