更新时间:2023-11-29 19:03:52
不确定为什么要手动识别单元格类型,但如果要将案例空或空白视为单个案例,则可以使用其他版本的Row.getCell,它采用第二个参数指定缺少单元格策略。
Not sure why you want to identify manually the cell type but if you want to treat cases "null" or "blank" as a single case you can use the other version of Row.getCell, which takes a second argument that specifies the missing cell policy.
所以:
xcell= xrow.getCell(cell);
将成为:
xcell = xrow.getCell(cell, Row.RETURN_NULL_AS_BLANK);
所以在任何情况下,单元格都有一个值或为空,但从不为空。
so in any cases the cell has a value or is blank , but never null.