嗨,当我尝试检查以下 if 条件时,出现字符串索引超出范围异常
String details="";
if("C".equalsIgnoreCase(reportType.substring(0,1)))
{
details="CASH BOOK FROM "+startDate+" TO "+endDate+" **"+shortName;
}
else
{
details="BANK BOOK FROM "+startDate+" TO "+endDate+" **"+shortName;
}
String index out of range: 1
: 这是错误信息
提前致谢