有没有办法使用 jxl 获取特定工作表“Sheet_name”的索引?
jxl库的getSheet(String name)函数是做什么的?
提前致谢。
Nope, there isn't.
A very simple solution would be:
final String sheetName = "somesheet";
Integer index = null;
final Sheet[] sheets = workbook.getSheets();
for(int i=0;i<sheets.length && index == null; i++) {
if(sheets[i].getName().equals(sheetName)) {
index = i;
}
}